kylekatarnls/multi-tester
Run dependent projects’ test suites against your current package changes. Multi-tester swaps your package into other projects’ vendor dirs and executes their unit/CI (Travis-friendly) commands, helping catch breaking changes early in Composer ecosystems.
Install the Package
Add multi-tester as a dev dependency in your Laravel package:
composer require kylekatarnls/multi-tester --dev
Initialize Configuration
Create a .multi-tester.yml file in your project root. Example for testing against Laravel core and a common auth package:
laravel/framework:
version: ^10.0
spatie/laravel-permission:
version: ^5.0
First Test Run Execute the command to test your package against the configured dependencies:
vendor/bin/multi-tester
Add a New Dependency
To add a new package dynamically (e.g., nesbot/carbon):
vendor/bin/multi-tester --add=nesbot/carbon
composer.json and push changes.multi-tester to validate against Laravel’s test suite and other critical dependencies.multi-tester into your Laravel package’s CI pipeline (e.g., GitHub Actions or GitLab CI) to run cross-project tests on every push.jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: composer install
- run: vendor/bin/multi-tester
--stop-on-failure flag to halt the pipeline if any dependent test fails.laravel/framework:9.*:
script: vendor/bin/phpunit --testsuite=Unit
laravel/framework:10.*:
script: vendor/bin/phpunit --testsuite=Unit
laravel/framework:11.*:
script: vendor/bin/phpunit --testsuite=Unit
travis shortcuts in your config to inherit the dependency’s CI setup.spatie/laravel-permission:
travis # Automatically pulls `install` and `script` from .travis.yml
illuminate/support:
install: composer install --prefer-dist --no-interaction
script: vendor/bin/phpunit --filter=AuthTest
--add flag to dynamically include dependencies during development.vendor/bin/multi-tester --add=laravel/valet --version=^4.0
laravel/framework and illuminate/* dependencies.--version to test against specific Laravel minor versions (e.g., laravel/framework:10.2.*).success_only: true to test against the last known good commit.config:
success_only: true
-v or --verbose to diagnose issues (e.g., failed clones or test runs).vendor/bin/multi-tester -v
Composer Autoload Conflicts
composer dump-autoload in the install script to regenerate autoload files.
my/package:
install: composer dump-autoload && composer install
Git Clone Failures
clone command or use SSH URLs if GitHub Actions is involved.
private/package:
clone: git clone git@github.com:org/private-package.git .
PHP Version Mismatches
composer require php:^8.1 in your package’s composer.json or configure multi-tester to use a compatible PHP version in CI.Travis CI Shortcut Limitations
travis shortcut may not work if the dependency’s .travis.yml is malformed or missing.install and script if the shortcut fails.Working Directory Isolation
success_only: true or clean the working directory between runs:
config:
clean_after: true
Packagist API Rate Limits
libraries.io as a fallback (configured automatically).-v to see detailed output for each step (clone, install, test)..multi-tester.yml.install or script to debug specific issues:
problematic/package:
install: composer install --verbose
script: vendor/bin/phpunit -d
Custom Commands
my/package:
pre_test: php artisan migrate:fresh
script: vendor/bin/phpunit
Parallel Testing
xargs or parallel to run multi-tester against multiple configs in parallel:
find . -name "*.multi-tester.yml" -exec vendor/bin/multi-tester {} \;
GitHub Actions Matrix
multi-tester with GitHub Actions’ matrix strategy to test against multiple Laravel versions:
strategy:
matrix:
laravel: [9.*, 10.*, 11.*]
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: vendor/bin/multi-tester --config=.multi-tester-${{ matrix.laravel }}.yml
Custom Config Files
dev.multi-tester.yml vs. prod.multi-tester.yml):
vendor/bin/multi-tester path/to/config.yml
APP_ENV and DB_CONNECTION are set in the dependent package’s environment.pre_test script:
my/package:
pre_test: php artisan package:discover
script: vendor/bin/phpunit
How can I help you explore Laravel packages today?