Setting SapphireTest::is_running_test() in PHPUnit bootstrap

Otherwise conditional logic will only succeed
when run through "sake dev/tests", not when
run through phpunit directly (which is the recommended way now)
This commit is contained in:
Ingo Schommer 2013-01-09 23:31:10 +01:00
parent 2ace1de328
commit e8bfc241fd
2 changed files with 5 additions and 0 deletions

View File

@ -131,6 +131,9 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
return self::$is_running_test;
}
public static function set_is_running_test($bool) {
self::$is_running_test = $bool;
}
/**
* Set the manifest to be used to look up test classes by helper functions

View File

@ -61,6 +61,8 @@ $controller = new FakeController();
// Get test manifest
TestRunner::use_test_manifest();
SapphireTest::set_is_running_test(true);
// Remove the error handler so that PHPUnit can add its own
restore_error_handler();