MDL-78167 lib: Added missing class properties in tests

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.

Adding @runTestsInSeparateProcesses and removing setUp() and tearDown() at the
component_test.php, so the test will run in a separate process making sure that
whatever changes happen to the in-memory version of the component class in its thread,
therefore does not impact other tests and makes it more safe.
This commit is contained in:
Meirza
2023-05-27 09:24:59 +07:00
parent 4ed782dd03
commit b7008d33ea
7 changed files with 39 additions and 32 deletions
+21
View File
@@ -700,6 +700,27 @@ class core_testable_persistent extends persistent {
const TABLE = 'phpunit_persistent';
/** @var bool before validate status. */
public ?bool $beforevalidate;
/** @var bool before create status. */
public ?bool $beforecreate;
/** @var bool before update status. */
public ?bool $beforeupdate;
/** @var bool before delete status. */
public ?bool $beforedelete;
/** @var bool after create status. */
public ?bool $aftercreate;
/** @var bool after update status. */
public ?bool $afterupdate;
/** @var bool after delete status. */
public ?bool $afterdelete;
protected static function define_properties() {
return array(
'shortname' => array(