Method getMockForAbstractClass() of class PHPUnit\Framework\TestCase is deprecated in PHPUnit 10 - Step 3

Created on 27 March 2024, about 2 months ago
Updated 29 April 2024, 19 days ago

Problem/Motivation

Method getMockForAbstractClass() of class PHPUnit\Framework\TestCase is deprecated in PHPUnit 10

Proposed resolution

In this issue, convert usages in

  1. core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php
  2. core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
  3. core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php
  4. core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php
  5. core/tests/Drupal/Tests/Core/Test/WebDriverTestBaseTest.php

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

10.3

Component
PHPUnit 

Last updated 1 minute ago

Created by

🇮🇹Italy mondrake 🇮🇹

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

Merge Requests

Comments & Activities

  • Issue created by @mondrake
  • Merge request !7212Closes #3436490 → (Open) created by mondrake
  • Pipeline finished with Failed
    about 2 months ago
    Total: 189s
    #130744
  • Pipeline finished with Failed
    about 2 months ago
    Total: 189s
    #130784
  • Pipeline finished with Failed
    about 2 months ago
    Total: 201s
    #130809
  • Pipeline finished with Failed
    about 2 months ago
    Total: 620s
    #130814
  • Assigned to mondrake
  • Status changed to Needs work about 2 months ago
  • Pipeline finished with Failed
    about 2 months ago
    Total: 166s
    #131317
  • Pipeline finished with Failed
    about 2 months ago
    Total: 523s
    #131330
  • Pipeline finished with Success
    about 2 months ago
    Total: 541s
    #131344
  • Issue was unassigned.
  • Pipeline finished with Failed
    about 2 months ago
    Total: 180s
    #133924
  • Pipeline finished with Success
    about 2 months ago
    Total: 507s
    #133929
  • Pipeline finished with Success
    about 2 months ago
    Total: 604s
    #134658
  • Pipeline finished with Success
    about 1 month ago
    Total: 2240s
    #137353
  • 🇮🇹Italy mondrake 🇮🇹

    It' s hard at this point to find a way to group the missing conversions in logical chunks of similar scope, but still can't go for a big change.

    So I propose in this step to just limit to 6 conversions:

    1. core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php
    2. core/modules/forum/tests/src/Unit/Breadcrumb/ForumBreadcrumbBuilderBaseTest.php
    3. core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
    4. core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php
    5. core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php
    6. core/tests/Drupal/Tests/Core/Test/WebDriverTestBaseTest.php
  • Status changed to Needs review about 1 month ago
  • 🇮🇹Italy mondrake 🇮🇹

    Rebased after removal of the Forum module.

  • Pipeline finished with Success
    27 days ago
    Total: 1432s
    #152678
  • Status changed to RTBC 20 days ago
  • 🇺🇸United States smustgrave

    Refactor seems fine with test coverage not being lost. Leaning on the green tests for this one.

  • Status changed to Fixed 19 days ago
  • 🇬🇧United Kingdom catch

    Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks!

    • catch committed 7b9f4c99 on 11.x
      Issue #3436490 by mondrake: Method getMockForAbstractClass() of class...
    • catch committed 45cd46b3 on 10.3.x
      Issue #3436490 by mondrake: Method getMockForAbstractClass() of class...
    • catch committed 7b9f4c99 on 11.0.x
      Issue #3436490 by mondrake: Method getMockForAbstractClass() of class...
Production build 0.67.2 2024