Problem/Motivation
I've stumbled over the following inspection in the PHPStorm plugin "Php Inspections (EA Extended)" called "promote ->willReturn*".
This points out PHPUnit MockObject ->expects()->will() which have $this->returnValue as a stub and replaces them with ->expects()->willReturn() (and friends).
I think at the very least it improves readability.
Since this is going to be a big patch touching _a lot_ of Test Classes, this is going to be something we want to (attempt to) commit in the 9.5 beta phase.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3295880
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #6
spokjeComment #7
spokjeComment #8
spokjeComment #9
longwaveReviewed with git diff --color-words, everything is as expected. The only remaining uses of
$this->returnValue*in core are:Should we just clean these up here as well and be done with it?
Comment #10
spokjeThanks @longwave, changed the last two remaining
$this->returnValueComment #11
longwaveThank you @Spokje!
Comment #12
alexpottCommitted and pushed fdaf5636e4 to 10.1.x and 7b462737ca to 10.0.x. Thanks!
Committed 6cb7c2a and pushed to 9.5.x. Thanks!