📥Installation

Add this composer package to your Laravel project:

composer req alexis-gss/unit-tests-laravel

Then, copy few configuration files in your application from vendor package file:

php artisan vendor:publish --provider="LaravelUnitTests\UnitTestsServiceProvider"

You can also use the following command:

php artisan vendor:publish

and select the package provider

LaravelUnitTests\UnitTestsServiceProvider

To publish only configuration files required for tests execution, you can use the tag:

--tag="config"

To publish only the authentication tests file, you can use the tag:

--tag="auth"

To overload existing files (adding this tag is recommended for proper package operation), you can use the option:

--force

Update the configuration file config/unit-test.php according to your project.

Finally, run all the tests and see the result:

php artisan test

Last updated