Skip to content
Browse files

Fixing missing headers when in plain text reporting.

  • Loading branch information...
1 parent e061a53 commit 88f58dfbe8aa187b2a381d5be70e7ae594de1b77 @markstory markstory committed
Showing with 12 additions and 1 deletion.
  1. +12 −1 cake/tests/lib/reporter/cake_text_reporter.php
View
13 cake/tests/lib/reporter/cake_text_reporter.php
@@ -28,6 +28,17 @@
class CakeTextReporter extends CakeBaseReporter {
/**
+ * Sets the text/plain header if the test is not a CLI test.
+ *
+ * @return void
+ */
+ function paintDocumentStart() {
+ if (!SimpleReporter::inCli()) {
+ header('Content-type: text/plain');
+ }
+ }
+
+/**
* Paints the end of the test with a summary of
* the passes and failures.
*
@@ -52,6 +63,7 @@ function paintFooter($test_name) {
echo 'Peak memory use: (in bytes): ' . number_format(memory_get_peak_usage()) . "\n";
}
}
+
/**
* Paints the title only.
*
@@ -60,7 +72,6 @@ function paintFooter($test_name) {
* @access public
*/
function paintHeader($test_name) {
- header('Content-type: text/plain');
echo "$test_name\n";
flush();
}

0 comments on commit 88f58df

Please sign in to comment.
Something went wrong with that request. Please try again.