X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2F1ParsingBugsTest.php;h=28bb9d55627055b0a2f98dc11a0e65a31d929c3f;hb=9337670bd021202018213a156c0083dd72902571;hp=4bbccba082e76620145daf3d2e9f25c183185e18;hpb=2d54bc797b2cd53055ab103065a4cd7d6c8d6580;p=plcapi.git diff --git a/tests/1ParsingBugsTest.php b/tests/1ParsingBugsTest.php index 4bbccba..28bb9d5 100644 --- a/tests/1ParsingBugsTest.php +++ b/tests/1ParsingBugsTest.php @@ -9,17 +9,29 @@ class ParsingBugsTests extends PHPUnit_Framework_TestCase { public $args = array(); - public function setUp() + protected function setUp() { $this->args = argParser::getArgs(); + if ($this->args['DEBUG'] == 1) + ob_start(); + } + + protected function tearDown() + { + if ($this->args['DEBUG'] != 1) + return; + $out = ob_get_clean(); + $status = $this->getStatus(); + if ($status == PHPUnit_Runner_BaseTestRunner::STATUS_ERROR + || $status == PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE) { + echo $out; + } } protected function newMsg($methodName, $params = array()) { $msg = new xmlrpcmsg($methodName, $params); - if ($this->args['DEBUG']) { - $msg->setDebug($this->args['DEBUG']); - } + $msg->setDebug($this->args['DEBUG']); return $msg; }