10000 Use willReturn() instead of will(returnValue()) by derrabus · Pull Request #31738 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Use willReturn() instead of will(returnValue()) #31738

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

Merged

Conversation

derrabus
Copy link
Member
Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets N/A
License MIT
Doc PR N/A

In a recent PR, fabbot complained about the usage of will(returnValue()) in test cases that I haven't changed. In this PR, I've applied the PHP CS Fixer's php_unit_mock_short_will_return fixer on the whole codebase.

@nicolas-grekas
Copy link
Member
nicolas-grekas commented May 30, 2019

Conflicts with #31737, not possible because these methods don't exist on phpunit 4.8, which we need for testing with PHP 5.5.

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone May 30, 2019
@nicolas-grekas
Copy link
Member

(unless I'm mistaken)

@derrabus
Copy link
Member Author

@derrabus
Copy link
Member Author

Also: The Travis build is green. 🙃

@nicolas-grekas
Copy link
Member

Great :) Can you then update the php_cs file?

@derrabus derrabus force-pushed the improvement/phpunit-will-return branch from f324f54 to 4fb67df Compare May 30, 2019 15:48
@derrabus
Copy link
Member Author

Done.

@nicolas-grekas
Copy link
Member

Thank you @derrabus.

@nicolas-grekas nicolas-grekas merged commit 4fb67df into symfony:3.4 May 30, 2019
nicolas-grekas added a commit that referenced this pull request May 30, 2019
This PR was merged into the 3.4 branch.

Discussion
----------

Use willReturn() instead of will(returnValue())

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

In a recent PR, fabbot complained about the usage of will(returnValue()) in test cases that I haven't changed. In this PR, I've applied the PHP CS Fixer's `php_unit_mock_short_will_return` fixer on the whole codebase.

Commits
-------

4fb67df Use willReturn() instead of will(returnValue()).
@derrabus derrabus deleted the improvement/phpunit-will-return branch May 30, 2019 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0