Review 12.4 Merged

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

Stefan Bürk CR +2 V +2 Easy +22 −16 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 require --dev \
    "phpunit/phpunit":"^10.5.5" \
    "typo3/testing-framework":"^8.0.8"

[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 1316

  1. Stefan Bürk uploaded patch set 1 12/28/23, 09:42

  2. 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/50976

  3. Stefan Bürk abandoned the change 12/28/23, 12:44

  4. Stefan Bürk restored the change 12/28/23, 13:31

  5. Stefan Bürk uploaded patch set 2 V -1 12/28/23, 13:31

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

  7. Oliver Klee voted on patch set 2 V +1 12/28/23, 13:51

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

  9. Simon Schaufelberger commented on patch set 2 12/28/23, 14:39

    an exception
    An additional
  10. Simon Schaufelberger updated the commit message in patch set 3 CR +1 V +1 12/28/23, 14:43

  11. Simon Schaufelberger commented on patch set 3 CR +1 V +1 12/28/23, 14:45

    Reply

    Done

    Reply

    Done
  12. core-ci voted on patch set 3 V +1 12/28/23, 14:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50985

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

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

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

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