Skip to content

Commit 459efda

Browse files
committed
display error_log only if the test has failed
1 parent 081cef3 commit 459efda

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Tests/PersistUnit/ModelTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ public function tearDown(){
184184
// display error log if any
185185
$errorlogFile = self::$errorLogDir.'/'. md5($this->getName());
186186
if(file_exists($errorlogFile)){
187-
echo PHP_EOL.file_get_contents($errorlogFile).PHP_EOL;
187+
if($this->hasFailed()){
188+
echo PHP_EOL.file_get_contents($errorlogFile).PHP_EOL;
189+
}
188190
unlink($errorlogFile);
189191
}
190192
}

0 commit comments

Comments
 (0)