Summer Sale! All accounts are 50% off this week.

Sarbas's avatar

Consecutive Facades Calls Testing

How can I test consecutive calls of facade? I need to check arguments values for several calls of the Redis facade. In PHPUnit we have the withConsecutive() method of mock. But the Redis::spy() object has withArgs() method only.

0 likes
1 reply
bobbybouwmann's avatar

I don't think you can do this with the default facade mock in Laravel at this point. Laravel only supports the basic spy functionality

Documentation: http://docs.mockery.io/en/latest/reference/spies.html

You can also mock the facade Redis yourself and perform all the checks you need. But of course, this is more work ;)

1 like

Please or to participate in this conversation.