saloon
saloon copied to clipboard
Add assert sent in order assertion
In Laravel there's quite a neat assertion on the Http client called assertSentInOrder
, it kind of does what it says on the tin, it allows you to check that the requests that are made are sent in the same order as you expect them.
To me this opens up quite a few testing scenarios like this:
$mockClient->assertSentInOrder([
function (FirstRequest $request) {
// some specific assertion on the first request + type info
return true;
},
function (SecondRequest $request) {
// some specific assertion on the second request + type info
return true;
},
])