Overrides Laravel's artisan test command to delegate to an external run-tests binary when APP_ENV is not testing. Falls back to the standard Collision-backed test runner when running in the testing environment.
Since this package is not published on Packagist, install it directly from its repository by adding a repositories entry to your Laravel project's composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/ts1997/laravel-devenv-testing"
}
]
}Then require the package:
composer require ts1997/laravel-devenv-testing:^1.0The package auto-discovers its service provider via Laravel's package discovery.
Composer resolves versions from git tags. To publish a new release, create an annotated tag and push it:
git tag -a v1.0.0 -m "v1.0.0"
git push origin v1.0.0Tags must follow semver and be prefixed with v (e.g. v1.0.0, v1.2.3). After pushing, Composer can resolve any constraint that matches, such as ^1.0 or 1.0.*.
When you run php artisan test, the command checks the current application environment:
- Not
testing— spawns an externalrun-testsprocess, forwarding all additional CLI arguments, and streams its output back to the console. testing— delegates to the standardNunoMaduro\Collisiontest runner as normal.
# Delegates to the `run-tests` binary (any env other than "testing")
php artisan test
# Runs via Collision's test runner (APP_ENV=testing)
APP_ENV=testing php artisan testcomposer testPlease see CHANGELOG for recent changes.
The MIT License (MIT). Please see License File for more information.