From 459efda6b1953546b97288c4f46265bd10bb4955 Mon Sep 17 00:00:00 2001 From: Raaghu Date: Tue, 20 Mar 2018 15:39:43 +0530 Subject: [PATCH] display error_log only if the test has failed --- src/Tests/PersistUnit/ModelTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Tests/PersistUnit/ModelTest.php b/src/Tests/PersistUnit/ModelTest.php index dc154e2..1cf7ba4 100644 --- a/src/Tests/PersistUnit/ModelTest.php +++ b/src/Tests/PersistUnit/ModelTest.php @@ -184,7 +184,9 @@ public function tearDown(){ // display error log if any $errorlogFile = self::$errorLogDir.'/'. md5($this->getName()); if(file_exists($errorlogFile)){ - echo PHP_EOL.file_get_contents($errorlogFile).PHP_EOL; + if($this->hasFailed()){ + echo PHP_EOL.file_get_contents($errorlogFile).PHP_EOL; + } unlink($errorlogFile); } }