Skip to content

TS1997/laravel-devenv-testing

Repository files navigation

Laravel Devenv Testing

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.

Installation

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.0

The package auto-discovers its service provider via Laravel's package discovery.

Tagging a Release

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.0

Tags 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.*.

How It Works

When you run php artisan test, the command checks the current application environment:

  • Not testing — spawns an external run-tests process, forwarding all additional CLI arguments, and streams its output back to the console.
  • testing — delegates to the standard NunoMaduro\Collision test runner as normal.

Usage

# 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 test

Testing

composer test

Changelog

Please see CHANGELOG for recent changes.

License

The MIT License (MIT). Please see License File for more information.

About

Overrides Laravel's artisan test command to delegate to an external devenv test runner when not in the testing environment.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors