Making CakeTextReporter work a little nicer in a CLI context.

Updating documentation on TestManager.
This commit is contained in:
mark_story 2010-06-26 13:48:55 -04:00
parent 0baab93929
commit bbf5a051e0
2 changed files with 7 additions and 5 deletions

View file

@ -36,16 +36,18 @@ class CakeTextReporter extends CakeBaseReporter {
* @return void * @return void
*/ */
public function paintDocumentStart() { public function paintDocumentStart() {
header('Content-type: text/plain'); if (!headers_sent()) {
header('Content-type: text/plain');
}
} }
/** /**
* undocumented function * Paints a pass
* *
* @return void * @return void
*/ */
public function paintPass() { public function paintPass() {
echo '.';
} }
/** /**
@ -75,7 +77,7 @@ class CakeTextReporter extends CakeBaseReporter {
*/ */
public function paintFooter($result) { public function paintFooter($result) {
if ($result->failureCount() + $result->errorCount() == 0) { if ($result->failureCount() + $result->errorCount() == 0) {
echo "OK\n"; echo "\nOK\n";
} else { } else {
echo "FAILURES!!!\n"; echo "FAILURES!!!\n";
} }

View file

@ -145,7 +145,7 @@ class TestManager {
* Runs the main testSuite and attaches to it a reporter * 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. * @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) { protected function run($reporter, $codeCoverage = false) {
restore_error_handler(); restore_error_handler();