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

Created on 25 August 2023, 10 months ago
Updated 13 October 2023, 9 months 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 less than a minute 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.69.0 2024