Created
June 13, 2020 14:18
-
-
Save jarektkaczyk/5b74b5078265113eb1a840cb403c98bf to your computer and use it in GitHub Desktop.
phpunit consecutive meh
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 | |
// meh | |
$mock | |
->method('sum') | |
->withConsecutive([1,2,3], [4,5,6]) | |
->willReturnOnConsecutiveCalls(6, 15); | |
// instead? | |
$mock->method('sum')->with(1,2,3)->willReturn(6); | |
$mock->method('sum')->with(4,5,6)->willReturn(15); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment