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

Use willReturn() in mocks instead of will(returnValue()) #4954

Merged
merged 1 commit into from Nov 6, 2021

Conversation

morozov
Copy link
Member

@morozov morozov commented Nov 6, 2021

Q A
Type improvement
BC Break no

The calls like $mock->will($this->returnValue($value)) are unnecessary verbose and may cause conflicts with 4.0.x which enforces static calls as self::returnValue().

Using the shortcut consistently will make it simpler to identify the no longer needed mocks in 4.0.x where PHPUnit will be able to generate them automatically based on the method return type.

@morozov morozov added this to the 2.13.5 milestone Nov 6, 2021
@morozov morozov merged commit 089ba10 into doctrine:2.13.x Nov 6, 2021
@morozov morozov deleted the will-return branch November 10, 2021 04:46
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants