Replace call to deprecated method setMethods() of class MockBuilder with onlyMethods()

Created on 25 August 2023, over 1 year ago
Updated 13 October 2023, about 1 year ago

Problem/Motivation

As (soon to be) discovered by mglaman/phpstan-drupal 1.2.0 (see 📌 Bump mglaman/phpstan-drupal to latest to make daily "updated deps" QA run pass again Fixed ), 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 📌 Introduce TestRun objects and refactor TestDatabase to be testable Fixed we reintroduced one occurrence.

Let's replace that sole survivor in this issue.

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

11.0 🔥

Component
PHPUnit 

Last updated about 15 hours ago

Created by

🇳🇱Netherlands spokje

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024