PHPUnit Zero Configuration Setup
Requires devbox.
# open the devbox shell
$ devbox shell
Starting a devbox shell...
# run phpunit using the provided configuration
(devbox) $ phpunit
PHPUnit 12.1.0 by Sebastian Bergmann and contributors.
Runtime: PHP 8.4.6
Configuration: phpunit.dist.xml
.. 2 / 2 (100%)
Time: 00:00.002, Memory: 8.00 MB
OK (2 tests, 2 assertions)
- Entering the shell runs the
init_hookindevbox.json, which runscomposer install, which sets up the autoloader, required for the phpunit bootstrap. - You can also run
devbox run testto runphpunit, included to demonstrate how to add scripts. - The test php code has been adapted from PHPUnit's documentation.
- PHPStorm configuration added.