diff options
-rw-r--r-- | .build_number | 2 | ||||
-rw-r--r-- | modules/gallery_unit_test/controllers/gallery_unit_test.php | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/.build_number b/.build_number index c5637259..2700e3f1 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=387 +build_number=388 diff --git a/modules/gallery_unit_test/controllers/gallery_unit_test.php b/modules/gallery_unit_test/controllers/gallery_unit_test.php index 3275d741..6b2bf479 100644 --- a/modules/gallery_unit_test/controllers/gallery_unit_test.php +++ b/modules/gallery_unit_test/controllers/gallery_unit_test.php @@ -145,9 +145,14 @@ class Gallery_Unit_Test_Controller extends Controller { print $e->getTraceAsString() . "\n"; } - $failed = 0; - foreach ($unit_test->stats as $class => $stats) { - $failed += ($stats["failed"] + $stats["errors"]); + if (!isset($unit_test)) { + // If an exception is thrown, it's possible that $unit_test was never set. + $failed = 1; + } else { + $failed = 0; + foreach ($unit_test->stats as $class => $stats) { + $failed += ($stats["failed"] + $stats["errors"]); + } } if (PHP_SAPI == 'cli') { exit($failed); |