MDL-44339 treat unexpected debugging() calls in phpunit tests as errors

This commit is contained in:
Petr Škoda
2014-03-14 11:43:46 +08:00
parent c0e88129d1
commit c386f35bca
+4 -1
View File
@@ -82,8 +82,11 @@ abstract class advanced_testcase extends PHPUnit_Framework_TestCase {
$DB = phpunit_util::get_global_backup('DB');
// Deal with any debugging messages.
phpunit_util::display_debugging_messages();
$debugerror = phpunit_util::display_debugging_messages();
phpunit_util::reset_debugging();
if ($debugerror) {
trigger_error('Unenxpected debugging() call detected.', E_USER_NOTICE);
}
} catch (Exception $e) {
// cleanup after failed expectation