-
Improvement
-
Resolution: Fixed
-
Major
-
4.2.5, 4.3.2
-
2
-
Team Hedgehog 2023 Review 4, Team Hedgehog 2024 Sprint 1.1
I'm getting some PHPUnit failures while implementing a new feature.
After investigating, I saw that many places where PHPUnit tests are using something like this
$messages = $messagesink->get_messages();
|
$message = reset($messages);
|
// Do the check for message content.
|
Most of the tests assume that we have only one message/email at that time or the expected message of the test is always the first one.
Which is not always correct.
For example: You're doing the test for mod_forum.
The test creates one message for mod_forum component and the other component also creates one message.
At this time $messagesink->get_messages(); will return 2 messages and $message = reset($messages) does not always return the message for mod_forum.
We should create a new method like
get_messages_by_component(string $component)
|
By that way, we can get the correct messages for the component we're doing the test.
- blocks
-
MDL-4188 Send course welcome message for manual and self enrolments
-
- Closed
-