Review main Merged

80940[TASK] Stop using getAccessibleMockForAbstractClass in EXT:core

Oliver Klee CR +2 V +2 Hard +280 −5 updated 09/18/23, 10:24

Commit message

`getMockForAbstractClass` has been (soft-)deprecated in PHPUnit 10.1:
https://github.com/sebastianbergmann/phpunit/issues/5241

Hence, we should replace its usages to follow best practices and
avoid deprecation warnings later with PHPUnit 11.

We do this by creating dedicated fixture subclasses of the affected
abstract classes.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Benni Mack +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 911

  1. Oliver Klee uploaded patch set 1 09/10/23, 12:27

  2. core-ci voted on patch set 1 V +1 09/10/23, 12:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46442

  3. Benni Mack updated the commit message in patch set 2 V +1 09/11/23, 07:08

  4. Benni Mack voted on patch set 2 V +1 CR +1 09/11/23, 07:08

  5. core-ci voted on patch set 2 V +1 09/11/23, 07:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46457

  6. Benjamin Franzke voted on patch set 2 V +2 CR +2 09/11/23, 07:19

  7. Oliver Klee commented on patch set 2 09/11/23, 07:48

    I'd suggest not backporting this to 12.4. The other changes for getMockForAbstractClass have been main-only as well (e.g., https://review.typo3.org/c/Packages/TYPO3.CMS/+/80522), and hence we won't be able to switch V12 to PHPUnit 11 anyway.
  8. Benjamin Franzke commented on patch set 2 09/11/23, 08:10

    Reply

    phpunit 10 is EOL Feb 2025, while 12.4 is EOL Apr 2026, so we actually want phpunit 11 in v12. The issue is that the other patchsets have not been backported. (I will do that.)
  9. Benjamin Franzke merged patch set 3 09/11/23, 08:10

  10. Oliver Klee commented on patch set 3 09/11/23, 08:15

    Reply

    Ah, I wasn't aware of these plans. Good to know. Thanks (also for willing to take care the backports)! Do you need a list of the changes to be backported? (Otherwise, they should be quick to find - they're all by me, I created all of them after the T3DD23, and they all should have "getAccessibleMock" in the commit message subject line.)
  11. Christian Kuhn commented on patch set 3 09/18/23, 10:24

    Reply

    i don't agree: there is no urgent need to use phpunit >v10 in core v12, even if phpunit v10 is eol when v12 is near to eol as well.