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

Created on 27 March 2024, 9 months ago
Updated 26 May 2024, 7 months 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 about 13 hours ago

Created by

🇮🇹Italy mondrake 🇮🇹

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Issue created by @mondrake
  • Merge request !7212Closes #3436490 → (Closed) created by mondrake
  • Pipeline finished with Failed
    9 months ago
    Total: 189s
    #130744
  • Pipeline finished with Failed
    9 months ago
    Total: 189s
    #130784
  • Pipeline finished with Failed
    9 months ago
    Total: 201s
    #130809
  • Pipeline finished with Failed
    9 months ago
    Total: 620s
    #130814
  • Assigned to mondrake
  • Status changed to Needs work 9 months ago
  • 🇮🇹Italy mondrake 🇮🇹
  • Pipeline finished with Failed
    9 months ago
    Total: 166s
    #131317
  • Pipeline finished with Failed
    9 months ago
    Total: 523s
    #131330
  • Pipeline finished with Success
    9 months ago
    Total: 541s
    #131344
  • Issue was unassigned.
  • 🇮🇹Italy mondrake 🇮🇹
  • Pipeline finished with Failed
    9 months ago
    Total: 180s
    #133924
  • Pipeline finished with Success
    9 months ago
    Total: 507s
    #133929
  • Pipeline finished with Success
    9 months ago
    Total: 604s
    #134658
  • Pipeline finished with Success
    9 months 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 9 months ago
  • 🇮🇹Italy mondrake 🇮🇹
  • 🇮🇹Italy mondrake 🇮🇹

    Rebased after removal of the Forum module.

  • Pipeline finished with Success
    8 months ago
    Total: 1432s
    #152678
  • Status changed to RTBC 8 months 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 8 months 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.71.5 2024