testo / error-handler
Error handler interceptor plugin for the Testo testing framework.
Fund package maintenance!
Requires
- php: >=8.2
- testo/testo: 0.10.60 - 1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Error handler plugin
Important
🪞 This is a read-only mirror.
Active development of the Testo project lives in php-testo/testo under plugin/error-handler/. This repository is automatically synchronized from there on every release.
File issues and pull requests in the main monorepo, not here.
About
Puts an error handler around every test and records the PHP warnings, notices and deprecations it raises on the test result, so they no longer scroll by while the test passes. Unhandled errors are printed to the stderr channel as PHP would print them, and with failOnError any captured error fails the test.
A handler installed before the test, such as an application bootstrap, still runs first. A test that installs its own handler and leaves it in place is reported as Risky unless it declares the change with #[ExpectErrorHandlerChange].
Install
composer require --dev testo/error-handler