#1583: Test framework doesn't specify exception type
--------------------------+-------------------------------------------------
Reporter: jtaal | Owner: jwage
Type: enhancement | Status: new
Priority: minor | Milestone: 1.0.4
Component: Attributes | Version: 1.0.3
Resolution: | Keywords:
Has_test: 0 | Mystatus: Pending Core Response
Has_patch: 1 |
--------------------------+-------------------------------------------------
Old description:
> 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() .
> "\n\nTrace\n-------------\n\n" . $e->getTraceAsString();;
> + $this->_messages[] = 'Unexpected ' . get_class($e) . '
> thrown in [' . get_class($testCase) . '] with message [' .
> $e->getMessage() . '] in ' . $e->getFile() . ' on line ' . $e->getLine()
> . "\n\nTrace\n-------------\n\n" . $e->getTraceAsString();;
>
> }
> $this->_passed += $testCase->getPassCount();
New description:
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() .
"\n\nTrace\n-------------\n\n" . $e->getTraceAsString();;
+ $this->_messages[] = 'Unexpected ' . get_class($e) . '
thrown in [' . get_class($testCase) . '] with message [' .
$e->getMessage() . '] in ' . $e->getFile() . ' on line ' . $e->getLine() .
"\n\nTrace\n-------------\n\n" . $e->getTraceAsString();;
}
$this->_passed += $testCase->getPassCount();
}}}
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1583#comment:1>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---