Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Use PHPUnit_Framework_TestFailure::exceptionToString if invocation expectations fail #108

Merged
merged 2 commits into from Nov 24, 2012

Conversation

fabian
Copy link
Contributor

@fabian 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'
 )

…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
Copy link
Sponsor Collaborator

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants