MDL-4188 core_course: Modify PHPUnit to use the new sink method

This commit is contained in:
Huong Nguyen 2024-01-30 11:37:18 +07:00
parent c4e07686ea
commit ad4f35f5a3
No known key found for this signature in database
GPG Key ID: 40D88AB693A3E72A

View File

@ -113,7 +113,7 @@ class courserequest_test extends \advanced_testcase {
$this->setAdminUser();
$sink = $this->redirectMessages();
$id = $cr->approve();
$this->assertCount(1, $sink->get_messages());
$this->assertCount(1, $sink->get_messages_by_component_and_type('core', 'courserequestapproved'));
$sink->close();
$course = $DB->get_record('course', array('id' => $id));
$this->assertEquals($data->fullname, $course->fullname);
@ -133,7 +133,7 @@ class courserequest_test extends \advanced_testcase {
$this->setAdminUser();
$sink = $this->redirectMessages();
$id = $cr->approve();
$this->assertCount(1, $sink->get_messages());
$this->assertCount(1, $sink->get_messages_by_component_and_type('core', 'courserequestapproved'));
$sink->close();
$course = $DB->get_record('course', array('id' => $id));
$this->assertEquals($data->category, $course->category);