jeroenvanderlaan / phpunit-cli-setup
A PHPUnit extension for preparing test suite execution using CLI commands
dev-master
2021-03-29 22:08 UTC
Requires
- php: >=8.0
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-04-29 04:53:26 UTC
README
A PHPUnit extension for preparing test suite execution using CLI commands.
This package is a work in progess.
Install
composer require --dev jeroenvanderlaan/phpunit-cli-setup
Currently only PHP 8 and PHPUnit 9.5 are supported.
Usage
Add the CliSetupExtension
to your phpunit.xml
<extension>
configuration and have it execute CLI commands before running your test suite(s).
<phpunit> <extensions> <extension class="Jeroenvanderlaan\PhpUnitCliSetup\Extension\CliSetupExtension"> <arguments> <string>bin/my-command</string> </arguments> </extension> </extensions> </phpunit>
This will execute bin/my-command
before running your test suite(s).
Optionally, you can limit the execution of CLI commands to specific test suites only.
<phpunit> <extensions> <extension class="Jeroenvanderlaan\PhpUnitCliSetup\Extension\CliSetupExtension"> <arguments> <string>bin/my-command</string> <array> <element key="0"> <string>my-test-suite</string> </element> </array> </arguments> </extension> </extensions> </phpunit>
This will execute bin/my-command
only when running the test suite my-test-suite
.