Permalink
Browse files

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)
  • Loading branch information...
chillu committed Jan 9, 2013
1 parent 2ace1de commit e8bfc241fdc5ff957646fe2ff2a2b05a243ad96e
Showing with 5 additions and 0 deletions.
  1. +3 −0 dev/SapphireTest.php
  2. +2 −0 tests/bootstrap.php
View
@@ -131,6 +131,9 @@ public static function 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
View
@@ -61,6 +61,8 @@
// 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();

0 comments on commit e8bfc24

Please sign in to comment.