Review main Merged

94874[TASK] Upgrade to PHPUnit 13

Wouter Wolters CR +2 V +2 Expert +908 −465 updated 08/13/26, 15:33

Commit message

Raise the dev-dependency to PHPUnit 13 and fix all resulting
deprecations and notices in test-only related files.

Dependency bump:

* composer.json: raise phpunit/phpunit from ^11.5.55 to ^13.2.6

* composer.json: drop the direct dev-dependency on
  sebastian/recursion-context. It was pinned to ^6.0.3 to get a
  PHP 8.5 compatible version when composerInstallMin is used, which
  PHPUnit 13 now requires on its own.

Test runner configuration:

* Build/phpunit/UnitTests.xml and Build/phpunit/FunctionalTests.xml:
  replace the deprecated "cacheResult" attribute with
  "recordTestRunHistory" and raise the referenced schema to 13.2.

Test doubles:

* Configure an unbounded expects($this->atMost(PHP_INT_MAX))
  expectation for doubles that constrain their calls with with().
  Those cannot become stubs, since with() is only available on mock
  objects.

* Add #[AllowMockObjectsWithoutExpectations] that legitimately keep a
  mock object without expectations, most notably all users of the
  MockObject based getAccessibleMock() of the testing framework and
  partial mocks.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
  • Verified V +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 164

Show 144 more files

Review log 3753

Show 1928 earlier messages
  1. Wouter Wolters uploaded patch set 1 07/21/26, 20:51

  2. core-ci voted on patch set 1 V -1 07/21/26, 21:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105126

  3. Wouter Wolters uploaded patch set 2 V -1 07/22/26, 15:15

  4. core-ci voted on patch set 2 V +1 07/22/26, 15:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105188

  5. Wouter Wolters updated the commit message in patch set 3 V +1 07/22/26, 16:06

  6. Wouter Wolters marked it ready for review 07/22/26, 16:06

  7. core-ci voted on patch set 3 V +1 07/22/26, 16:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105190

  8. Garvin Hicking updated the commit message in patch set 4 V +1 07/22/26, 16:41

  9. Garvin Hicking commented on patch set 4 07/22/26, 16:43

    Thanks for putting effort into this! I was planning to look at this for about a year now.... :-D I have used Claude Opus to create a commit message. I have not manually verified this yet. Prompt: The commit 50674c879a73736b1d73c93e5870afe07e67d097 in this repository introduces an update to PHPUnit 13. The commit message is too sparse. Go through all changes and see which kinds of fixes were made. Many of them seem to deal with stub/mock replacements. Go through each change and create a list of changes, which can act as a better commit message. Just use normal text indentation and bullet points, no ASCII tables. Keep the changes concise, and every single change in the end must fit into the list you made. Make no mistakes.
  10. Wouter Wolters commented on patch set 4 07/22/26, 16:47

    Reply

    Thanks, as you can see at my latest work for TYPO3 more than a year ago I was already trying to update to PHPUnit 12. Did all the prepartions for it etc. But I needed the PHP raise to at least PHP 8.3, that is now the case with PHP 8.5. I coordinated this already with Lolli and Benni for a while :)
  11. core-ci voted on patch set 4 V +1 07/22/26, 16:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105194

  12. Simon Schaufelberger commented on patch set 4 CR +1 V +1 07/22/26, 18:18

    Reply

    Did you use Rector or did you do everything by hand? Rector has lots of rules to automate phpunit migrations if you don't know
  13. Garvin Hicking commented on patch set 4 07/22/26, 20:55

    (running a nightly on this now)
  14. core-ci commented on patch set 4 07/22/26, 21:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105197

  15. Wouter Wolters commented on patch set 4 07/22/26, 21:35

    Reply

    Rector was used but that did not cover everything. Lots of notices had to do with dataproviders and wrong count of function parameters. 3 expected but 4 given for example. So it is as combination of Rector, AI and my own work.
  16. Andreas Kienast commented on patch set 4 CR -1 07/23/26, 04:50

    Sorry for being a party pooper here. Instead of using the `AllowMockObjectsWithoutExpectations` attribute I'd prefer to replace affected mocks with stubs. This works for me at least in `StateUtilityTest`.
  17. Garvin Hicking commented on patch set 4 07/23/26, 05:04

    Reply

    Done
  18. Benjamin Franzke commented on patch set 4 07/23/26, 07:30

    FormInlineAjaxControllerTest.php:61

    It seems like `AllowMockObjectsWithoutExpectations` and migration from `createMock` to `createStub` was mixed and this class. It seems that `AllowMockObjectsWithoutExpectations` is probably no longer needed here, right? I guess this was lost during migration. I'd vote for splitting this patch, e.g. migrate all applicable cases to `createStub()` first, since this can easily done beforehand and eases the review a lot.
  19. Wouter Wolters commented on patch set 4 07/23/26, 18:44

  20. Wouter Wolters marked it work in progress 07/29/26, 16:38

  21. Wouter Wolters uploaded patch set 5 CR +1 V +1 07/29/26, 16:38

  22. core-ci voted on patch set 5 V -1 07/29/26, 16:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105628

  23. Wouter Wolters uploaded patch set 6 V -1 07/29/26, 17:05

  24. core-ci voted on patch set 6 V -1 07/29/26, 17:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105629

  25. Wouter Wolters uploaded patch set 7 V -1 07/29/26, 18:25

  26. core-ci voted on patch set 7 V +1 07/29/26, 18:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105630

  27. Wouter Wolters uploaded patch set 8 V +1 07/30/26, 16:05

  28. core-ci voted on patch set 8 V +1 07/30/26, 16:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105702

  1. Wouter Wolters uploaded patch set 9 V +1 07/30/26, 16:32

  2. core-ci voted on patch set 9 V +1 07/30/26, 16:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105704

  3. Wouter Wolters marked it ready for review 07/30/26, 16:40

  4. Oliver Klee voted on patch set 9 V +1 07/30/26, 17:28

  5. Benni Mack uploaded patch set 10 V +1 08/12/26, 04:50

  6. core-ci voted on patch set 10 V +1 08/12/26, 04:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106482

  7. Benni Mack uploaded patch set 11 V +1 08/12/26, 06:16

  8. core-ci voted on patch set 11 V +1 08/12/26, 06:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106488

  9. Oliver Klee voted on patch set 11 V +1 08/12/26, 08:05

  10. Benni Mack commented on patch set 11 CR +1 V +1 08/12/26, 10:07

    Reply

    done

    FormInlineAjaxControllerTest.php:61 Reply

    createStubs() are merged now.
  11. Wouter Wolters uploaded patch set 12 CR +1 V +1 08/12/26, 21:01

  12. core-ci voted on patch set 12 V -1 08/12/26, 21:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106581

  13. Oliver Klee voted on patch set 12 CR +1 V +1 08/12/26, 22:04

  14. core-ci voted on patch set 12 V +1 08/12/26, 22:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106616

  15. Simon Schaufelberger uploaded patch set 13 CR +1 V +1 08/13/26, 09:35

  16. core-ci voted on patch set 13 V +1 08/13/26, 09:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106636

  17. Benni Mack voted on patch set 13 CR +1 V +1 08/13/26, 13:09

  18. Georg Ringer voted on patch set 13 CR +1 V +1 08/13/26, 13:50

  19. Stefan Bürk commented on patch set 13 CR -1 08/13/26, 14:31

    ``` Declare the additional, unused argument as $_ in the two test methods whose data provider hands over more values than the method signature accepted. ``` missed that one - need to recheck, only from reading I'll assume that that is not the right solution. But in the lookthrough in the morining I could not find it ... which file/dataprovider ? (rechecking later).
  20. Wouter Wolters updated the commit message in patch set 14 CR +1 V +1 08/13/26, 15:03

  21. Wouter Wolters commented on patch set 14 08/13/26, 15:04

    Reply

    That has been split in to other patches. Updated the commit message
  22. core-ci voted on patch set 14 V +1 08/13/26, 15:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106658

  23. Stefan Bürk voted on patch set 14 CR +1 V +1 08/13/26, 15:18

  24. Benni Mack voted on patch set 14 CR +2 V +2 08/13/26, 15:33

  25. Benni Mack merged patch set 15 08/13/26, 15:33