From da43ea4ef7ff0ec2f86fa3f3be62e794dc6f7c21 Mon Sep 17 00:00:00 2001 From: Meirza Date: Thu, 9 Feb 2023 07:59:30 +0700 Subject: [PATCH] MDL-77350 rating: Added class properties that are not declared In PHP 8.2 and later, setting a value to an undeclared class property is deprecated and emits a deprecation notice. So we need to add missing class properties that still need to be declared. --- rating/tests/externallib_test.php | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/rating/tests/externallib_test.php b/rating/tests/externallib_test.php index 32d16c3b2bf..e4890ed1f76 100644 --- a/rating/tests/externallib_test.php +++ b/rating/tests/externallib_test.php @@ -46,6 +46,45 @@ require_once($CFG->dirroot . '/rating/lib.php'); */ class externallib_test extends externallib_advanced_testcase { + /** @var \stdClass course record. */ + protected $course; + + /** @var \stdClass user record. */ + protected $student1; + + /** @var \stdClass user record. */ + protected $teacher1; + + /** @var \stdClass user record. */ + protected $student2; + + /** @var \stdClass user record. */ + protected $teacher2; + + /** @var \stdClass user record. */ + protected $student3; + + /** @var \stdClass user record. */ + protected $teacher3; + + /** @var \stdClass activity record. */ + protected $forum; + + /** @var \stdClass activity record. */ + protected $discussion; + + /** @var int context instance ID. */ + protected $contextid; + + /** @var \stdClass forum post. */ + protected $post; + + /** @var \stdClass a fieldset object, false or exception if error not found. */ + protected $studentrole; + + /** @var \stdClass a fieldset object, false or exception if error not found. */ + protected $teacherrole; + /* * Set up for every test */