Skip to content
abenevaut edited this page Nov 23, 2024 · 3 revisions

phpunit-slicer documentation

PHPUnit-slicer is a tool to split a PHPUnit test suite into multiple test suites.

Install

From latest release

PHPUnit-slicer binary is available on release page

curl -L -o phpunit-slicer https://github.com/abenevaut/phpunit-slicer/releases/latest/download/phpunit-slicer
chmod +x phpunit-slicer

A hash file is available to check the integrity of the binary.

curl -L -o phpunit-slicer https://github.com/abenevaut/phpunit-slicer/releases/latest/download/phpunit-slicer.sha512sum
sha512sum -c phpunit-slicer.sha512sum

From composer

Or, you can install the tool locally or globally with composer, depending on your usage.

composer require abenevaut/phpunit-slicer
composer global require abenevaut/phpunit-slicer

Usage

phpunit-slicer slice 4 ./phpunit.xml.dist ./phpunit.xml ./tests

Use cases

vendor/bin/phpunit --testsuite sliced-testsuite-0 --configuration phpunit.xml
vendor/bin/pest --testsuite sliced-testsuite-1 --configuration phpunit.xml
php artisan test --testsuite sliced-testsuite-2 --configuration phpunit.xml
php laravel-zero-project test --testsuite sliced-testsuite-3 --configuration phpunit.xml
Clone this wiki locally