Skip to content

Commit

Permalink
Fixed bogus expectation in ExceptionStackTest.
Browse files Browse the repository at this point in the history
Catching a PHPUnit exception and rethrowing it as a non-PHPUnit exception does not make any sense.
  • Loading branch information
sun committed Jul 26, 2014
1 parent 1aefe3a commit abc60f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions tests/TextUI/exception-stack.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Time: %s, Memory: %sMb
There were 2 errors:

1) ExceptionStackTest::testPrintingChildException
ExceptionStackTestException: Child exception
PHPUnit_Framework_Exception: Child exception
message
Failed asserting that two arrays are equal.
--- Expected
Expand All @@ -31,7 +31,6 @@ Failed asserting that two arrays are equal.
)


%s:%i
%s:%i

Caused by
Expand Down
4 changes: 1 addition & 3 deletions tests/_files/ExceptionStackTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php
class ExceptionStackTestException extends Exception { }

class ExceptionStackTest extends PHPUnit_Framework_TestCase
{
public function testPrintingChildException()
Expand All @@ -9,7 +7,7 @@ public function testPrintingChildException()
$this->assertEquals(array(1), array(2), 'message');
} catch (PHPUnit_Framework_ExpectationFailedException $e) {
$message = $e->getMessage() . $e->getComparisonFailure()->getDiff();
throw new ExceptionStackTestException("Child exception\n$message", 101, $e);
throw new PHPUnit_Framework_Exception("Child exception\n$message", 101, $e);
}
}

Expand Down

0 comments on commit abc60f8

Please sign in to comment.