X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2F3LocalhostTest.php;h=ea7c5bf0178da0579c2b0a87e38a54375da97c69;hb=9337670bd021202018213a156c0083dd72902571;hp=a0e9b2a3d8009f9ffae126fdd795d53cb470aeea;hpb=2d54bc797b2cd53055ab103065a4cd7d6c8d6580;p=plcapi.git diff --git a/tests/3LocalhostTest.php b/tests/3LocalhostTest.php index a0e9b2a..ea7c5bf 100644 --- a/tests/3LocalhostTest.php +++ b/tests/3LocalhostTest.php @@ -85,13 +85,27 @@ class LocalhostTest extends PHPUnit_Framework_TestCase } else { $this->client = new xmlrpc_client($this->args['URI'], $this->args['LOCALSERVER']); } - if ($this->args['DEBUG']) { - $this->client->setDebug($this->args['DEBUG']); - } + + $this->client->setDebug($this->args['DEBUG']); $this->client->request_compression = $this->request_compression; $this->client->accepted_compression = $this->accepted_compression; $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] ); + + 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 send($msg, $errrorcode = 0, $return_response = false)