Allows mocking of final methods and classes in PHP.
Created by, and is maintained by Nuno Maduro, and once installed it automatically allows mocking of final methods and classes.
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. 🏄♂️
- First, we run the file autoload.php using Composer Autoload.
- Then, if you are running the command PHPUnit, we use the library dg/bypass-finals to remove final keywords from source code on-the-fly: https://github.com/nunomaduro/mock-final-classes/src/Runner.php#L31.
Mock Final Classes is an open-sourced software licensed under the MIT license.