You can't test code that calls exit()
PHP's exit construct stops the process before your assertions can run. Mantle Testkit's terminate_request() preserves the same terminal behavior while turning the response into something your tests can inspect.
wordpress / laravel / ai
writing
Long-form notes on WordPress at scale, PHP tooling, and the unglamorous work of keeping large publishing systems boring.
PHP's exit construct stops the process before your assertions can run. Mantle Testkit's terminate_request() preserves the same terminal behavior while turning the response into something your tests can inspect.
An older plugin of mine on .org.