Skip to content

Commit

Permalink
display error_log only if the test has failed
Browse files Browse the repository at this point in the history
  • Loading branch information
Raaghu committed Mar 20, 2018
1 parent 081cef3 commit 459efda
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Tests/PersistUnit/ModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 459efda

Please sign in to comment.