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 (and friends) as a stub and replaces them with ->expects()->willReturn() (and friends).

As seen in #3220128: [META] ->willReturn(...) would make more sense here (and friends) getting all of this committed in one go is way too much.

This sub-issue is about getting all ->willReturn(...) in, except ->willReturn() itself.

Remaining tasks

  • Patch/MR
  • Review
  • Commit
  • Rejoice

Issue fork drupal-3221312

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Spokje created an issue. See original summary.

Spokje’s picture

Spokje’s picture

Assigned: Spokje » Unassigned
Status: Active » Needs review

This seems like a manageable chunk to review.

Spokje’s picture

Issue summary: View changes
joachim’s picture

Status: Needs review » Reviewed & tested by the community

LGTM.

  • catch committed 6335af1 on 9.3.x
    Issue #3221312 by Spokje: ->willReturn(...) would make more sense here
    

  • catch committed 00efdb1 on 9.2.x
    Issue #3221312 by Spokje: ->willReturn(...) would make more sense here...
catch’s picture

Version: 9.3.x-dev » 9.2.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.3.x and cherry-picked to 9.2.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.