Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature | Add assertSentInOrder assertion to MockClient #400

Merged
merged 3 commits into from
Jun 9, 2024

Conversation

DaniTulp
Copy link
Contributor

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

@Sammyjo20
Copy link
Collaborator

Thanks for this PR @DaniTulp and sorry for the delay. I will be looking at this properly soon, just wanted to give you a response. I will need a little more time as I'd need to update the documentation.

@DaniTulp
Copy link
Contributor Author

@Sammyjo20 no problem, let me know if you need help with that!

Copy link
Collaborator

@Sammyjo20 Sammyjo20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome PR, thanks @DaniTulp!

@Sammyjo20 Sammyjo20 changed the title Add assert sent in order assertion Feature | Add assertSentInOrder assertion to MockClient Jun 9, 2024
@Sammyjo20 Sammyjo20 merged commit 0cb74a3 into saloonphp:v3 Jun 9, 2024
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants