X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2F2InvalidHostTest.php;h=0168c91efed0c33e1d7f0da6b64ea24f69bf5cd3;hb=9337670bd021202018213a156c0083dd72902571;hp=685bd59842ea0a554396c9c97bebe8ac2ae3c373;hpb=2d54bc797b2cd53055ab103065a4cd7d6c8d6580;p=plcapi.git diff --git a/tests/2InvalidHostTest.php b/tests/2InvalidHostTest.php index 685bd59..0168c91 100644 --- a/tests/2InvalidHostTest.php +++ b/tests/2InvalidHostTest.php @@ -15,8 +15,21 @@ class InvalidHostTest extends PHPUnit_Framework_TestCase $this->args = argParser::getArgs(); $this->client = new xmlrpc_client('/NOTEXIST.php', $this->args['LOCALSERVER'], 80); - if ($this->args['DEBUG']) { - $this->client->setDebug($this->args['DEBUG']); + $this->client->setDebug($this->args['DEBUG']); + + 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; } }