diff --git a/Tests/outputhtmlTest.php b/Tests/outputhtmlTest.php index d94a8c1..9d08b48 100644 --- a/Tests/outputhtmlTest.php +++ b/Tests/outputhtmlTest.php @@ -9,23 +9,23 @@ class test_outputhtml extends PHPUnit_Framework_TestCase /** Entry null */ public function testlayout1 () { + $this->expectOutputRegex ("#
\s+#"); $output = new outputhtml (); $res = $output->out (""); - $this->expectOutputRegex ("#\s+#", $res); } public function testlayout2 () { + $this->expectOutputRegex("#data#"); $output = new outputhtml (); $res = $output->out ("data"); - $this->expectOutputRegex("#data#"); } public function testlayout3 () { + $this->expectOutputRegex("#data#"); $output = new outputhtml (); $res = $output->out ("data", "title"); - $this->expectOutputRegex("#data#"); } public function testlayout4 () diff --git a/outputcsv.php b/outputcsv.php index c910d5d..80c8059 100644 --- a/outputcsv.php +++ b/outputcsv.php @@ -30,5 +30,7 @@ class outputcsv extends output $out = fopen ('php://output', 'w'); fputcsv ($out, $data); fclose ($out); + if (!defined ("PHPUNIT")) + exit; } } diff --git a/outputhtml.php b/outputhtml.php index 7144a4f..0f58bc3 100644 --- a/outputhtml.php +++ b/outputhtml.php @@ -90,6 +90,8 @@ EOT; $resView = str_replace ($key, $val, $resView); echo $resView; + if (!defined ("PHPUNIT")) + exit; } /** Get the layout and provide it the variables. The variables will be push in diff --git a/outputjson.php b/outputjson.php index d407a12..c0c768a 100644 --- a/outputjson.php +++ b/outputjson.php @@ -26,5 +26,7 @@ class outputjson extends output @header('Pragma: no-cache'); @header ("Content-Type: application/json"); echo json_encode ($data); + if (!defined ("PHPUNIT")) + exit; } } diff --git a/outputtxt.php b/outputtxt.php index 3087660..866e132 100644 --- a/outputtxt.php +++ b/outputtxt.php @@ -128,5 +128,7 @@ class outputtxt extends output echo "NULL\n"; else echo "TODO : ".gettype ($rc)." on ".__FILE__.":".__LINE__."\n"; + if (!defined ("PHPUNIT")) + exit; } } diff --git a/outputxml.php b/outputxml.php index 512b1b7..cd57d70 100644 --- a/outputxml.php +++ b/outputxml.php @@ -24,6 +24,8 @@ class outputxml extends output $this->array_to_xml ($data, $xml); //saving generated xml file print $xml->asXML(); + if (!defined ("PHPUNIT")) + exit; } /** function defination to convert array to xml