-
Notifications
You must be signed in to change notification settings - Fork 133
Closed
Description
I'm mocking a Laravel Eloquent model and want to check if the 'findOrFail' method is being invoked. I've managed to make a test double and the 'findOrFail' method does indeed return the value that I specify. However, when I check for the method invocation, it fails.
I did some digging and apparently the $calls variable in ClassProxy/getCallsForMethod is being filled with the following attribute (among others):
["__call"]=>
array(1) {
[0]=>
array(2) {
[0]=>
string(10) "findOrFail"
[1]=>
array(1) {
[0]=>
string(1) "1"
}
}
}
So the method invocation is being recorded but obviously the following code which checks for the invocation fails:
return isset($calls[$method])
? $calls[$method]
: [];
The method invocation can be found under $calls['__call'] and not $calls['findOrFail']
Is this something that needs to be fixed or can I go about this some other way?
Regards,
Ivo
Metadata
Metadata
Assignees
Labels
No labels