Ticket #1583 (closed enhancement: fixed)
Test framework doesn't specify exception type
| Reported by: | jtaal | Owned by: | jwage |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.0.4 |
| Component: | Attributes | Version: | 1.0.3 |
| Severity: | Keywords: | ||
| Cc: | Has Test: | no | |
| Status: | Pending Core Response | Has Patch: | yes |
Description (last modified by jwage) (diff)
When an unexpected exception occurs, it is not clear what the type of the exception is.
Suggestion:
Index: tests/DoctrineTest/GroupTest.php
===================================================================
--- tests/DoctrineTest/GroupTest.php (revision 5109)
+++ tests/DoctrineTest/GroupTest.php (working copy)
@@ -49,7 +49,7 @@
$testCase->run();
} catch(Exception $e) {
$this->_failed += 1;
- $this->_messages[] = 'Unexpected exception thrown in [' . get_class($testCase) . '] with message [' . $e->getMessage() . '] in ' . $e->getFile() . ' on line ' . $e->getLine() . "
Trace
-------------
" . $e->getTraceAsString();;
+ $this->_messages[] = 'Unexpected ' . get_class($e) . ' thrown in [' . get_class($testCase) . '] with message [' . $e->getMessage() . '] in ' . $e->getFile() . ' on line ' . $e->getLine() . "
Trace
-------------
" . $e->getTraceAsString();;
}
$this->_passed += $testCase->getPassCount();
Change History
Note: See
TracTickets for help on using
tickets.