MDL-36031 implement message redirection for unit testing
This commit is contained in:
@@ -306,6 +306,19 @@ abstract class advanced_testcase extends PHPUnit_Framework_TestCase {
|
||||
$this->assertEquals(0, $count, $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts message redirection.
|
||||
*
|
||||
* You can verify if messages were sent or not by inspecting the messages
|
||||
* array in the returned messaging sink instance. The redirection
|
||||
* can be stopped by calling $sink->close();
|
||||
*
|
||||
* @return phpunit_message_sink
|
||||
*/
|
||||
public function redirectMessages() {
|
||||
return phpunit_util::start_message_redirection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup after all tests are executed.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user