nunomaduro/mock-final-classes
Dev-only helper that automatically enables mocking of final classes and methods in PHP tests. Works with PHPUnit, Pest, and ParaTest by removing final keywords on the fly via dg/bypass-finals—install with Composer and it just works.
Requires PHP 7.1+
First, install the package using Composer:
composer require --dev nunomaduro/mock-final-classes
That's it! You can now mock final methods and classes. 🏄♂️
Most of the work is done by the library dg/bypass-finals, so make sure you support the maintainer here: Donate. Thank you!
Mock Final Classes is an open-sourced software licensed under the MIT license.
How can I help you explore Laravel packages today?