Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Adds PHPUnit 11 support #49622

Merged
merged 8 commits into from
Jan 10, 2024
Merged

Conversation

nunomaduro
Copy link
Member

@nunomaduro nunomaduro commented Jan 9, 2024

This pull request introduces support for PHPUnit 11 and Pest 3 in Laravel 11. While at the same time, supporting PHPUnit 10 and Pest 2. @taylorotwell, please be aware that we have implemented a few changes at the HandleExceptions level that require your review:

  1. We have deprecated the forgetApp method in favor of flushState.
  2. The flushState method not only forgets the app instance but also clears every exception|error handler previously set in PHP's global state. If PHPUnit had an error handler, we have reset it to the original one.
  3. The decision of clearing every exception|error handler previously set in PHP's global state is an important one. Because:
  • It fixes PHPUnit's message regarding Test code or tested code did not remove its own exception handlers.
  • It avoids memory leaks any vendor code setting their own exception|error handler hundreds of times on the test suite, because the application boots for every single test case.

@crynobone, could you please review and merge this pull request before we proceed with merging this one?

@nunomaduro nunomaduro marked this pull request as draft January 9, 2024 20:01
@crynobone crynobone marked this pull request as ready for review January 9, 2024 22:43
@nunomaduro nunomaduro marked this pull request as draft January 10, 2024 00:02
@nunomaduro nunomaduro self-assigned this Jan 10, 2024
@nunomaduro nunomaduro marked this pull request as ready for review January 10, 2024 00:03
@nunomaduro nunomaduro marked this pull request as draft January 10, 2024 00:07
composer.json Outdated Show resolved Hide resolved
.github/workflows/tests.yml Outdated Show resolved Hide resolved
Co-authored-by: Julius Kiekbusch <contact@julius-kiekbusch.de>
@nunomaduro nunomaduro marked this pull request as ready for review January 10, 2024 12:54
@taylorotwell taylorotwell merged commit 23b6adc into master Jan 10, 2024
29 checks passed
@taylorotwell taylorotwell deleted the feat/adds-phpunit11-support branch January 10, 2024 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants