mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
2ace1de328
commit
e8bfc241fd
@ -131,6 +131,9 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
|||||||
return self::$is_running_test;
|
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
|
* Set the manifest to be used to look up test classes by helper functions
|
||||||
|
@ -61,6 +61,8 @@ $controller = new FakeController();
|
|||||||
// Get test manifest
|
// Get test manifest
|
||||||
TestRunner::use_test_manifest();
|
TestRunner::use_test_manifest();
|
||||||
|
|
||||||
|
SapphireTest::set_is_running_test(true);
|
||||||
|
|
||||||
// Remove the error handler so that PHPUnit can add its own
|
// Remove the error handler so that PHPUnit can add its own
|
||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user