MDL-39846 implement event sink for unit testing

This commit is contained in:
Petr Škoda
2013-07-19 08:43:29 +02:00
parent a85258cac8
commit 62401e8fd5
6 changed files with 199 additions and 0 deletions
+13
View File
@@ -319,6 +319,19 @@ abstract class advanced_testcase extends PHPUnit_Framework_TestCase {
return phpunit_util::start_message_redirection();
}
/**
* Starts event redirection.
*
* You can verify if events were triggered or not by inspecting the events
* array in the returned event sink instance. The redirection
* can be stopped by calling $sink->close();
*
* @return phpunit_event_sink
*/
public function redirectEvents() {
return phpunit_util::start_event_redirection();
}
/**
* Cleanup after all tests are executed.
*