Skip to content

101 4.5 - numerous PHPUnit test failures - #102

Open
leonstr wants to merge 7 commits into
lsuonline:masterfrom
leonstr:101-phpuniterrors
Open

101 4.5 - numerous PHPUnit test failures#102
leonstr wants to merge 7 commits into
lsuonline:masterfrom
leonstr:101-phpuniterrors

Conversation

@leonstr

@leonstr leonstr commented Nov 21, 2024

Copy link
Copy Markdown

A series of proposed fixes for the warnings and errors seen running PHPUnit tests with Moodle 4.5 and PHP 8.3.

If you'd prefer a single commit please feel free to squash these.

Replace calls to update_system_config_value() with the core set_config()
function as the former did not invalidate the cache when setting values
resulting in changed values not taking effect.
Migrate from deprecated assertObjectHasAttribute() to
assertObjectHasProperty().
Previously PHPUnit tests used '1' for course and user IDs when creating
message objects.  But commit a382639 updated
block_quickmail\persistents\message->get_message_recipients() adding a
check that recipients are enrolled on the course, so bogus values no
longer work for tests that result in this method being called.  So where
necessary we use the data generator to create test users and enrol them
on courses.
@aspark21

aspark21 commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

@ChaoticDalo any chance of getting this merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants