Skip to content

Test file condition_test.php using old cm variable, causing failures #43

Description

@niko-hoogeveen

Hi team,
When running PHPUnit tests for this plugin, there are some failures/errors regarding condition_test.php. I think the failures are related to 69e5c26 where use of cm was updated with course.

Environment Details

PHP 8.1
MOODLE 4.5
MySQL 8.0
Branch: master

Here are the list of the error logs from PHPUnit:

1) availability_othercompleted_condition_testcase::test_update_dependency_id
Undefined property: stdClass::$cm

availability/condition/othercompleted/tests/condition_test.php:255
lib/phpunit/classes/advanced_testcase.php:76

2) availability_othercompleted_condition_testcase::test_constructor
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'{othercompleted:cm42 COMPLETE}'
+'{othercompleted:course42 COMPLETE}'

availability/condition/othercompleted/tests/condition_test.php:132
lib/phpunit/classes/advanced_testcase.php:76

3) availability_othercompleted_condition_testcase::test_save
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
 stdClass Object (
-    'cm' => 42
     'e' => 1
     'type' => 'othercompleted'
+    'course' => 42
 )

availability/condition/othercompleted/tests/condition_test.php:142
lib/phpunit/classes/advanced_testcase.php:76

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions