X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2F1ParsingBugsTest.php;h=6a6a3f99a492c33407d215c74c69e4b0fc052023;hb=5165658f984c1112f1f29e9663d5c334e71bdc98;hp=4bbccba082e76620145daf3d2e9f25c183185e18;hpb=a3b1d45eb2e1fd0712d574a423c6c4af8d512ee1;p=plcapi.git diff --git a/tests/1ParsingBugsTest.php b/tests/1ParsingBugsTest.php index 4bbccba..6a6a3f9 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; } @@ -439,7 +451,7 @@ and there they were.postid7414222assertEquals($string, $v); - $f = 'userid311127 + $f = 'userid311127 dateCreated20011126T09:17:52content' . utf8_encode($string) . 'postid7414222 '; $r = $s->parseResponse($f, false, 'phpvals'); @@ -466,7 +478,7 @@ and there they were.postid7414222assertEquals($string, $v); - $f = 'userid311127 + $f = 'userid311127 dateCreated20011126T09:17:52content' . $string . 'postid7414222 '; $r = $s->parseResponse($f, false, 'phpvals');