Review main Merged

83115[TASK] Use phpunit attributes in functional tests

Christian Kuhn CR +2 V +2 Impossible +4697 −11135 updated 02/25/24, 22:33

Commit message

phpunit 11 deprecates annotations like `@test` and
`@dataProvider` in favor of their attribute counterparts.

We'll adapt core main & v12 to keep v12 backports
simple. The patch takes care of Tests/Functional and
Tests/FunctionalDeprecated.

Script `Build/Scripts/splitFunctionalTests.php` is
adapted to deal with annotations for CI to continue
splitting functional tests into chunks. This also
fixes detection in two test cases that had unexpected
`@test` annotation combinations which were not properly
detected before.

> composer req --dev rector/rector
> wget https://forge.typo3.org/attachments/download/38273/rector.php
> find typo3/ -name \*Test.php | grep Tests/Functional | xargs bin/rector process
> rm rector.php
> composer rem --dev rector/rector

Minor manual adaption in a few files plus cgl fixes.

Also deny `@test` annotion in annotationChecker.php now
to not introduce new occurences with other patches anymore.
The script will receive another cleanup to look at further
obsolete annotations. `@dataProvider` is currently still
used in acceptance tests.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Anja Leichsenring +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Anja Leichsenring +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 2

Files 501

Show 481 more files

Review log 1420

  1. Christian Kuhn uploaded patch set 1 02/23/24, 16:46

  2. Christian Kuhn commented on patch set 1 CR -1 02/23/24, 16:47

    probably close to final version, but needs verification if all is good.
  3. core-ci voted on patch set 1 V -1 02/23/24, 16:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53511

  4. Christian Kuhn uploaded patch set 2 CR -1 V -1 02/25/24, 17:08

  5. core-ci voted on patch set 2 V +1 02/25/24, 17:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53552

  6. Christian Kuhn uploaded patch set 3 V +1 02/25/24, 17:20

  7. core-ci voted on patch set 3 V -1 02/25/24, 17:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53553

  8. Christian Kuhn uploaded patch set 4 V -1 02/25/24, 17:32

  9. core-ci voted on patch set 4 V +1 02/25/24, 17:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53554

  10. Christian Kuhn updated the commit message in patch set 5 V +1 02/25/24, 17:43

  11. core-ci voted on patch set 5 V +1 02/25/24, 17:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53555

  12. Oliver Klee voted on patch set 5 V +1 02/25/24, 17:52

  13. Christian Kuhn uploaded patch set 6 V +1 02/25/24, 17:56

  14. core-ci voted on patch set 6 V +1 02/25/24, 18:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53556

  15. Christian Kuhn voted on patch set 6 CR +1 V +1 02/25/24, 18:02

  16. Anja Leichsenring voted on patch set 6 CR +1 V +1 02/25/24, 18:21

  17. Simon Schaufelberger commented on patch set 6 02/25/24, 20:49

    splitFunctionalTests.php:211

    can we avoid this deep nesting by early return?
  18. Stefan Bürk commented on patch set 6 CR +1 V +1 02/25/24, 21:15

    splitFunctionalTests.php:211 Reply

    IMO no change to before - and in this case more a nitpic. Would change that here for now. Would not change that here for now.
  19. Christian Kuhn voted on patch set 6 CR +2 V +2 02/25/24, 22:32

  20. Christian Kuhn merged patch set 7 02/25/24, 22:33