Commit 82a248fe authored by meus's avatar meus

Added a try/catch block around the running of each test to catch unexpected

exceptions and log them. 
parent 879a2139
...@@ -40,7 +40,12 @@ class GroupTest extends UnitTestCase ...@@ -40,7 +40,12 @@ class GroupTest extends UnitTestCase
if ( ! $this->shouldBeRun($testCase, $filter)) { if ( ! $this->shouldBeRun($testCase, $filter)) {
continue; continue;
} }
$testCase->run(); 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->_passed += $testCase->getPassCount();
$this->_failed += $testCase->getFailCount(); $this->_failed += $testCase->getFailCount();
$this->_messages = array_merge($this->_messages, $testCase->getMessages()); $this->_messages = array_merge($this->_messages, $testCase->getMessages());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment