From b031c8ff8b02484fe234d50822a237f0a4d81b45 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 23 Sep 2008 03:22:13 +0000 Subject: [PATCH] Added status notifications to cli test runs git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62912 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- dev/CliTestReporter.php | 11 ++++++++++- dev/TestRunner.php | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dev/CliTestReporter.php b/dev/CliTestReporter.php index 679b89c25..87d7f3521 100644 --- a/dev/CliTestReporter.php +++ b/dev/CliTestReporter.php @@ -21,10 +21,19 @@ class CliTestReporter extends SapphireTestReporter { } } $result = ($failCount > 0) ? 'fail' : 'pass'; - echo "$testCount tests run: $passCount passes, $failCount fails, and 0 exceptions\n\n"; + echo "\n\n$testCount tests run: $passCount passes, $failCount fails, and 0 exceptions\n\n"; } public function endTest( PHPUnit_Framework_Test $test, $time) { + // Status indicator, a la PHPUnit + switch($this->currentTest['status']) { + case TEST_FAILURE: echo "F"; break; + case TEST_ERROR: echo "E"; break; + case TEST_INCOMPLETE: echo "I"; break; + case TEST_SUCCESS: echo "."; break; + default: echo "?"; break; + } + parent::endTest($test, $time); $this->writeTest($this->currentTest); } diff --git a/dev/TestRunner.php b/dev/TestRunner.php index b57fa08ed..a35eebe72 100644 --- a/dev/TestRunner.php +++ b/dev/TestRunner.php @@ -162,7 +162,7 @@ class TestRunner extends Controller { $suite->run($results); } - echo '
'; + if(!Director::is_cli()) echo '
'; $reporter->writeResults(); if(!Director::is_cli()) echo '
';