Review main Merged

82282[TASK] Align error handler tests with changed PHPUnit behavior

Stefan Bürk CR +2 V +2 Easy +20 −14 updated 12/28/23, 20:06

Commit message

PHPUnit has changed the behavior of the error handler in
several ways, for example introducing a PHP attribute to
disable the PHPUnit error handler for tests dealing with
`error_get_last()` [1], throwing an exception and stopping
the script execution on `E_*_ERROR` or clearing the error
result [2] - which breaks the ability to use the native
`error_get_last()` method to test custom error handler
implementation.

Something which TYPO3 needs to do for the provided custom
error handler.

An additional change [3] to check and restore error handlers
with levels has been reverted due to issues in the Laravel
world.

This change modifies the related test to use the introduced
PHP attribute `#[WithoutErrorHandler]` and raises PHPUnit.

Note: PHPUnit does not recognize the `@test` doc-block
      annotation if the `#[WithoutErrorHandler]` attribute
      is used. Therefore, the attribute counterparts for
      `@test` and `@dataProvider` has been added on top
      and not exclusively for now, albeit looking weird
      and fishy. This needs to be addressed in a more
      generic way in a dedicated change.

Used command(s):

> composer update typo3/testing-framework
> composer require --dev "phpunit/phpunit":"^10.5.5"

[1] https://github.com/sebastianbergmann/phpunit/pull/5430
[2] https://github.com/sebastianbergmann/phpunit/pull/5592
[3] https://github.com/sebastianbergmann/phpunit/pull/5619

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
    • Anja Leichsenring +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
    • Anja Leichsenring +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 1827

Show 2 earlier messages
  1. Stefan Bürk uploaded patch set 1 12/28/23, 09:40

  2. Stefan Bürk uploaded patch set 2 12/28/23, 09:45

  1. core-ci voted on patch set 1 V -1 12/28/23, 09:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50975

  2. core-ci voted on patch set 2 V -1 12/28/23, 09:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50977

  3. Stefan Bürk uploaded patch set 3 V -1 12/28/23, 09:58

  4. core-ci voted on patch set 3 V -1 12/28/23, 10:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50978

  5. Stefan Bürk uploaded patch set 4 V -1 12/28/23, 12:22

  6. core-ci voted on patch set 4 V -1 12/28/23, 12:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50979

  7. Stefan Bürk uploaded patch set 5 12/28/23, 12:30

    Copied Votes: * Verified-1 (copy condition: "**changekind:NO_CHANGE**")
  8. core-ci voted on patch set 5 V -1 12/28/23, 12:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50980

  9. Stefan Bürk uploaded patch set 6 V -1 12/28/23, 12:37

  10. core-ci voted on patch set 6 V +1 12/28/23, 12:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50981

  11. Stefan Bürk uploaded patch set 7 V +1 12/28/23, 13:29

  12. core-ci voted on patch set 7 V +1 12/28/23, 13:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50982

  13. Oliver Klee commented on patch set 7 12/28/23, 13:51

    ErrorHandlerTest.php:76

    With the attributes added now, I think we can drop the PHPDoc annotations.
  14. Oliver Klee commented on patch set 7 12/28/23, 13:51

    ErrorHandlerTest.php:76 Reply

    Argh, scratch that. Forgot to read the full commit message.
  15. Oliver Klee voted on patch set 7 V +1 12/28/23, 13:51

  16. Oliver Klee voted on patch set 7 CR +1 12/28/23, 13:52

  17. Simon Schaufelberger updated the commit message in patch set 8 CR +1 V +1 12/28/23, 14:41

  18. Simon Schaufelberger updated the commit message in patch set 9 12/28/23, 14:44

  19. Simon Schaufelberger voted on patch set 9 CR +1 V +1 12/28/23, 14:45

  20. core-ci voted on patch set 8 V +1 12/28/23, 14:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50984

  21. core-ci voted on patch set 9 V +1 12/28/23, 14:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50986

  22. Oliver Klee voted on patch set 9 CR +1 V +1 12/28/23, 14:55

  23. Anja Leichsenring voted on patch set 9 CR +1 V +1 12/28/23, 18:18

  24. Stefan Bürk voted on patch set 9 CR +2 V +2 12/28/23, 20:06

  25. Stefan Bürk merged patch set 10 12/28/23, 20:06