-
Notifications
You must be signed in to change notification settings - Fork 181
Open
Description
I've seen examples of the test_email_certificates_sitehome failing sporadically because of the order the emails were sent. This has been and hard to replicate consistently. This was found using postgress 17 on the MOODLE_404_STABLE branch and Moodle 4.5.
1) mod_customcert\email_certificate_task_test::test_email_certificates_sitehome
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'[email protected]'
+'[email protected]'
In my testing I saw that the siteadmin email can be sent either before or after the student emails, which affects the result of the test. This may be related to the ordering returned from get_users_by_capability.
moodle-mod_customcert/tests/email_certificate_task_test.php
Lines 288 to 292 in 723bbec
$this->assertEquals($CFG->noreplyaddress, $emails[1]->from); | |
$this->assertEquals($user1->email, $emails[1]->to); | |
$this->assertEquals($CFG->noreplyaddress, $emails[2]->from); | |
$this->assertEquals($user2->email, $emails[2]->to); |
I'm not sure why this is an issue when the student ordering isn't, but either way the test should be updated to not rely on ordering.
Metadata
Metadata
Assignees
Labels
No labels