Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Use PHPUnit_Framework_TestFailure::exceptionToString if invocation expectations fail #108

merged 2 commits into from Nov 24, 2012


None yet
2 participants

fabian commented Nov 15, 2012

Primarily to display a diff of the mismatching parameters.

If a larger array argument doesn't match the expectation, additional debugging is needed to see passed value.

With this change you get a nice diff for the mismatching argument:

Expectation failed for method name is equal to <string:right> when invoked 1 time(s).
Parameter 0 for invocation SomeClass::right(Array (...)) does not match expected value.
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => 'first'
-    1 => 'second'
+    0 => 'second'

fabian added some commits Nov 15, 2012

Use PHPUnit_Framework_TestFailure::exceptionToString if invocation ex…
…pectations fail

Primarily to display a diff of the mismatching parameters

edorian added a commit that referenced this pull request Nov 24, 2012

@edorian edorian merged commit a68eb7d into sebastianbergmann:master Nov 24, 2012


edorian commented Nov 24, 2012

I was wondering why it didn't nicely diff my failures recently.

Thanks bunch for making that happen also providing tests for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment