Added a try/catch block around the running of each test to catch unexpected
exceptions and log them.
This commit is contained in:
parent
879a213990
commit
82a248fee7
@ -40,7 +40,12 @@ class GroupTest extends UnitTestCase
|
||||
if ( ! $this->shouldBeRun($testCase, $filter)) {
|
||||
continue;
|
||||
}
|
||||
try{
|
||||
$testCase->run();
|
||||
}catch(Exception $e){
|
||||
$this->_failed += 1;
|
||||
$this->_messages[] = "Unexpected exception thrown with message [" . $e->getMessage() . "] in " . get_class($testCase) . " on line " . $e->getLine();
|
||||
}
|
||||
$this->_passed += $testCase->getPassCount();
|
||||
$this->_failed += $testCase->getFailCount();
|
||||
$this->_messages = array_merge($this->_messages, $testCase->getMessages());
|
||||
|
Loading…
Reference in New Issue
Block a user