Skip to content

Commit

Permalink
Making CakeTextReporter work a little nicer in a CLI context.
Browse files Browse the repository at this point in the history
Updating documentation on TestManager.
  • Loading branch information
markstory committed Jun 26, 2010
1 parent 0baab93 commit bbf5a05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions cake/tests/lib/reporter/cake_text_reporter.php
Expand Up @@ -36,16 +36,18 @@ class CakeTextReporter extends CakeBaseReporter {
* @return void
*/
public function paintDocumentStart() {
header('Content-type: text/plain');
if (!headers_sent()) {
header('Content-type: text/plain');
}
}

/**
* undocumented function
* Paints a pass
*
* @return void
*/
public function paintPass() {

echo '.';
}

/**
Expand Down Expand Up @@ -75,7 +77,7 @@ public function paintFail($message) {
*/
public function paintFooter($result) {
if ($result->failureCount() + $result->errorCount() == 0) {
echo "OK\n";
echo "\nOK\n";
} else {
echo "FAILURES!!!\n";
}
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/lib/test_manager.php
Expand Up @@ -145,7 +145,7 @@ public function runTestCase($testCaseFile, PHPUnit_Framework_TestListener $repor
* Runs the main testSuite and attaches to it a reporter
*
* @param PHPUnit_Framework_TestListener $reporter Reporter instance to use with the group test being run.
* @return mixed Results of group test being run.
* @return PHPUnit_Framework_TestResult Result object of the test run.
*/
protected function run($reporter, $codeCoverage = false) {
restore_error_handler();
Expand Down

0 comments on commit bbf5a05

Please sign in to comment.