Problem/Motivation

As (soon to be) discovered by mglaman/phpstan-drupal 1.2.0 (see #3383279: Bump mglaman/phpstan-drupal to latest to make daily "updated deps" QA run pass again), we are using some deprecated functionality throughout Drupal core.

This issue is dealing with:

 ------ ------------------------------------------------------------- 
  Line   core/tests/Drupal/Tests/Core/Test/PhpUnitTestRunnerTest.php  
 ------ ------------------------------------------------------------- 
  29     Call to deprecated method setMethods() of class              
         PHPUnit\Framework\MockObject\MockBuilder:                    
         https://github.com/sebastianbergmann/phpunit/pull/3687       
 ------ ------------------------------------------------------------- 

Steps to reproduce

Proposed resolution

In #3130606: MockBuilder::setMethods is deprecated in PHPUnit8 and removed from PHPUnit10 we replaced all MockBuilder::setMethods() with MockBuilder::onlyMethods(), but in #3075608: Introduce TestRun objects and refactor TestDatabase to be testable we reintroduced one occurrence.

Let's replace that sole survivor in this issue.

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3383456

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:

Comments

Spokje created an issue. See original summary.

spokje’s picture

Status: Active » Needs review
spokje’s picture

Issue summary: View changes
spokje’s picture

Assigned: Unassigned » spokje
Status: Needs review » Needs work
spokje’s picture

Assigned: spokje » Unassigned
Status: Needs work » Needs review

Just a fluke random failure, back to NR.

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

Thank you!

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 11.x and 10.2.x. Did not backport cleanly to 10.1.x, not sure it's worth the effort.

  • longwave committed b5e711af on 10.2.x
    Issue #3383456 by Spokje: Replace call to deprecated method setMethods...

  • longwave committed 5a359db7 on 11.x
    Issue #3383456 by Spokje: Replace call to deprecated method setMethods...

Status: Fixed » Closed (fixed)

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