Created
November 9, 2017 11:01
-
-
Save pavlakis/7481ffd11241d2c79bab578903fac39c to your computer and use it in GitHub Desktop.
Mockery fails on with() with omitted optional values
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
class MyClass | |
{ | |
public function doStuff($param, array $optional = []) | |
{ | |
// some logic | |
return true; | |
} | |
} | |
// this fails | |
$myClassMock->shouldReceive('doStuff') | |
->with('some param') | |
->once() | |
->andReturn(true); | |
// this passes | |
$myClassMock->shouldReceive('doStuff') | |
->with('some param', []) | |
->once() | |
->andReturn(true); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment