Describe the bug
After https://moodle.atlassian.net/browse/MDL-85666, several checks and validations were added as part of the automated tests, in particular lib/tests/event/plugin_checks_test.php is failing on Moodle 4.5.6, see the error log:
core\event\plugin_checks_test::test_event_classes with data set "local_webhooks" ('local_webhooks', 'local', 'webhooks', '/builds/open-lms/product/edu/...bhooks')
Failed asserting that core\lang_string Object &00000000000342250000000000000000 (
'component' => 'moodle'
'a' => null
'string' => null
'forcedstring' => false
'identifier' => 'create'
'lang' => null
) is of type "string".
/builds/open-lms/product/edu/moodle/lib/tests/event/plugin_checks_test.php:57
/builds/open-lms/product/edu/moodle/lib/phpunit/classes/basic_testcase.php:64
since local_webhooks does not return a string, instead it returns a lang object for the following events:
local/webhooks/classes/event/backup_performed.php
local/webhooks/classes/event/backup_restored.php
local/webhooks/classes/event/response_answer.php
local/webhooks/classes/event/service_added.php
local/webhooks/classes/event/service_deleted.php
local/webhooks/classes/event/service_updated.php
Change return new lang_string('create', 'moodle'); to return get_string('create', 'moodle'); for every string used for events methods.
To Reproduce
Steps to reproduce the behavior:
- Set environment for PhpUnit testing, with Moodle 4.5.6 or new
- Run lib/tests/event/plugin_checks_test.php automated test
- See error
Expected behavior
No error is shown
Additional context
Review Moodle core ticket MDL-85666
Describe the bug
After https://moodle.atlassian.net/browse/MDL-85666, several checks and validations were added as part of the automated tests, in particular
lib/tests/event/plugin_checks_test.phpis failing on Moodle 4.5.6, see the error log:since local_webhooks does not return a string, instead it returns a lang object for the following events:
local/webhooks/classes/event/backup_performed.phplocal/webhooks/classes/event/backup_restored.phplocal/webhooks/classes/event/response_answer.phplocal/webhooks/classes/event/service_added.phplocal/webhooks/classes/event/service_deleted.phplocal/webhooks/classes/event/service_updated.phpChange
return new lang_string('create', 'moodle');toreturn get_string('create', 'moodle');for every string used for events methods.To Reproduce
Steps to reproduce the behavior:
Expected behavior
No error is shown
Additional context
Review Moodle core ticket MDL-85666