Ticket #1583 (closed enhancement: fixed)

Opened 9 months ago

Last modified 9 months ago

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

Changed 9 months ago by jwage

  • description modified (diff)

Changed 9 months ago by jwage

  • status changed from new to closed
  • resolution set to fixed

(In [5127]) [1.0, 1.1] fixes #1583

Note: See TracTickets for help on using tickets.