drachels / moodle-mod_mootyper

4 stars 18 forks source link

Error in phpUnit for core_calender #99

Closed mbs-LP closed 1 year ago

mbs-LP commented 2 years ago

Hi there,

running the core phpUnit for calender (core_calendar_container_testcase::test_delete_module_delete_events), one error occurs. We use the actual version 2021072200 of mod_mootyper.

There was 1 error:

1) core_calendar_container_testcase::test_delete_module_delete_events
Undefined property: stdClass::$grade_mootyper

/var/www/html/mod/mootyper/lib.php:803
/var/www/html/mod/mootyper/lib.php:289
/var/www/html/course/modlib.php:128
/var/www/html/lib/testing/generator/module_generator.php:271
/var/www/html/calendar/tests/container_test.php:445
/var/www/html/lib/phpunit/classes/advanced_testcase.php:80

ERRORS!
Tests: 18, Assertions: 76, Errors: 1.

Best regards.

drachels commented 2 years ago

Is your method of testing using any of the behat tests?

mbs-LP commented 2 years ago

No, we are just using phpUnit-Test for core_moodle.

drachels commented 2 years ago

I have been able to duplicate your results with the unit tests, however, I have NOT been able to verify that the test even created a MooTyper instance so that there is something to delete. Unfortunately, 3+ years ago when I started developing behat tests for MooTyper, we discovered my wife had pancreatic cancer. It was shortly after that, my server for behat testing died. I have not had any time to try and work on either of those until now. I just built a server and set up PHPUnit test and will try and track down what is occurring.

PM84 commented 2 years ago

I've figured out a possible workaround for this problem. After this, the unittests are fixed.

drachels commented 1 year ago

20221230 Closing here as the fix is in current release.