File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ abstract class Verifier {
16
16
*/
17
17
public $ className ;
18
18
19
- protected $ invokedFail = "Expected %s to be invoked but it never occur. " ;
19
+ protected $ invokedFail = "Expected %s to be invoked but it never occur. Got: %s " ;
20
20
protected $ notInvokedMultipleTimesFail = "Expected %s to be invoked %s times but it never occur. " ;
21
21
protected $ invokedMultipleTimesFail = "Expected %s to be invoked but called %s times but called %s. " ;
22
22
@@ -61,14 +61,16 @@ public function verifyInvoked($name, $params = null)
61
61
$ calls = $ this ->getCallsForMethod ($ name );
62
62
$ separator = $ this ->callSyntax ($ name );
63
63
64
- if (empty ($ calls )) throw new fail (sprintf ($ this ->invokedFail , $ this ->className .$ separator .$ name ));
64
+ if (empty ($ calls )) throw new fail (sprintf ($ this ->invokedFail , $ this ->className .$ separator .$ name, '' ));
65
65
66
66
if (is_array ($ params )) {
67
67
foreach ($ calls as $ args ) {
68
68
if ($ this ->onlyExpectedArguments ($ params , $ args ) === $ params ) return ;
69
69
}
70
- $ params = ArgumentsFormatter::toString ($ params );
71
- throw new fail (sprintf ($ this ->invokedFail , $ this ->className .$ separator .$ name ."( $ params) " ));
70
+ $ params = ArgumentsFormatter::toString ($ params );
71
+ $ gotParams = ArgumentsFormatter::toString ($ calls [0 ]);
72
+
73
+ throw new fail (sprintf ($ this ->invokedFail , $ this ->className .$ separator .$ name ."( $ params) " , $ this ->className .$ separator .$ name ."( $ gotParams) " ));
72
74
} else if (is_callable ($ params )) {
73
75
$ params ($ calls );
74
76
}
You can’t perform that action at this time.
0 commit comments