From 88f58dfbe8aa187b2a381d5be70e7ae594de1b77 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 19:19:09 -0500 Subject: [PATCH] Fixing missing headers when in plain text reporting. --- cake/tests/lib/reporter/cake_text_reporter.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cake/tests/lib/reporter/cake_text_reporter.php b/cake/tests/lib/reporter/cake_text_reporter.php index 4c3bf6c87af..dd793a475d4 100644 --- a/cake/tests/lib/reporter/cake_text_reporter.php +++ b/cake/tests/lib/reporter/cake_text_reporter.php @@ -27,6 +27,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(); }