You can extend PHPUnit by creating and using abstract test classes and traits - or by using PHPUnit's event system. As one of the contributors to PHPUnit's new event system, I will give you an overview of the iterations of PHPUnit's event systems, show how you can migrate from any of the previous event systems to PHPUnit's new event system, and share insights on components and the events in the new event system of PHPUnit.

Migrating an extension from the test listener event system to the hooks event system

Here is a https://github.com/johnkary/phpunit-speedtrap/pull/83, migrating johnkary/phpunit-speedtrap from the test listener event system to the hooks event system.

However, the hooks event system also has at least one disadvantage compared to the test listener event system.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners