saloon icon indicating copy to clipboard operation
saloon copied to clipboard

Add assert sent in order assertion

Open DaniTulp opened this issue 10 months ago • 0 comments

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;
            },
        ])

DaniTulp avatar Apr 11 '24 20:04 DaniTulp