Created
February 8, 2016 15:44
-
-
Save dnaber-de/3c0c36603fee173b0fa5 to your computer and use it in GitHub Desktop.
Approach on Monkey::action expects different values on consecutive calls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Brain\Monkey::actions() | |
->expectFired( 'do_something' ) | |
->twice() | |
->withArgs( | |
[ | |
'first', | |
'second' | |
] | |
); | |
do_action( 'do_something', 'first' ); | |
do_action( 'do_something', 'second' ); | |
//Mockery\Exception\NoMatchingExpectationException: No matching handler found for Mockery_0__do_do_something::do_action_do_something("first"). Either the method was unexpected or its arguments matched no expected argument list for this method | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks a lot, Giuseppe!
Yes, currently went with something like