mirror of
https://github.com/pestphp/pest.git
synced 2026-12-05 23:32:17 +01:00
9aed110ba0c500ed77c54212693903b3ad8f7166
pest()->afterAll() hooks by flushing statics after tearDownAfterClass() (#1753)
* fix: run `pest()->afterAll()` hooks by flushing statics after `tearDownAfterClass()` Fixes #1694 Testable::tearDown()'s finally block flushed the afterAll static after every test via TestCaseMethodFactory::tearDown(), so by the time PHPUnit called tearDownAfterClass() (which runs after the last test's tearDown()) the hook had already been nulled out. The per-test flush was redundant: TestCaseMethodFactory::setUp() already flushes statics before re-applying proxies for the next test. Move the flush into tearDownAfterClass()'s finally block instead, so it happens after the hook actually runs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * test: assert `afterAll` hooks run via isolated fixture suite Runs a fixture suite in a subprocess and asserts both the `pest()->afterAll()` and file-level `afterAll()` hooks ran once, in order. Fails on unpatched 5.x (only `afterAll` is recorded). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * style: remove comment from afterAll hook test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix afterAll test style and refresh snapshots --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
Pest v5 Now Available: Read the announcement ».
Pest is an elegant testing framework for PHP developers and AI agents.
- Explore our docs at pestphp.com »
- Follow the creator Nuno Maduro:
- YouTube: youtube.com/@nunomaduro — Videos every week
- Twitch: twitch.tv/nunomaduro — Live coding on Mondays, Wednesdays, and Fridays at 9PM UTC
- Twitter / X: x.com/enunomaduro
- LinkedIn: linkedin.com/in/nunomaduro
- Instagram: instagram.com/enunomaduro
- Tiktok: tiktok.com/@enunomaduro
Sponsors
We cannot thank our sponsors enough for their incredible support in funding Pest's development. Their contributions have been instrumental in making Pest the best it can be. For those who are interested in becoming a sponsor, please visit Nuno Maduro's Sponsor page at github.com/sponsors/nunomaduro.
- PhpStorm
- CodeRabbit
- SerpApi
- Bento
- CMS Max
- Redberry
- Typesense
- Pixel
- NativePHP
- TestMu AI
- Zapiet
- LoadForge
- Route4Me
- Nerdify
Pest is an open-sourced software licensed under the MIT license.
Languages
PHP
99.3%
HTML
0.6%
