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

Update at() matchers in Console #15472

Merged
merged 3 commits into from
Apr 28, 2021
Merged

Update at() matchers in Console #15472

merged 3 commits into from
Apr 28, 2021

Conversation

markstory
Copy link
Member

Update more tests to not use at(). Without at() we lose the ability to ensure method orders with mocks, as this is discouraged within PHPUnit mocks.

Update more tests to not use at(). Without at() we lose the ability to
ensure method orders with mocks, as this is discouraged within PHPUnit
mocks.
@markstory markstory added this to the 4.2.6 milestone Apr 28, 2021
@dereuromark
Copy link
Member

Without at() we lose the ability to ensure method orders with mocks

withConsecutive is the replacement when order matters, right?

@markstory
Copy link
Member Author

withConsecutive is the replacement when order matters, right?

Yes but you can't use that to ensure order across different methods.

@dereuromark
Copy link
Member

Then I dont find their way of removing useful methods a good way forward.
If people want to use it, they can use at(), otherwise once() or any() etc.
Dictating the removal seems weird and counterproductive. Is there any good argument for it?

Sure, overusing it can create maintenance overhead or failing tests when they don't need to be.
But that's user error, and not the fault of the existence of those in general.

@dereuromark
Copy link
Member

I see some comments and details here: sebastianbergmann/phpunit#4297

@othercorey
Copy link
Member

looks ok.

@markstory markstory merged commit 840148e into master Apr 28, 2021
@markstory markstory deleted the at-matcher-pt2 branch April 28, 2021 20:03
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.

3 participants