LaravelPackages.net
Acme Inc.
Toggle sidebar
vigneshc91/laravel-test-generator

Laravel package for generating unit test automatically

8.734
23
v0.0.5
About vigneshc91/laravel-test-generator

vigneshc91/laravel-test-generator is a Laravel package for laravel package for generating unit test automatically. It currently has 23 GitHub stars and 8.734 downloads on Packagist (latest version v0.0.5). Install it with composer require vigneshc91/laravel-test-generator. Discover more Laravel packages by vigneshc91 or browse all Laravel packages to compare alternatives.

Last updated

Laravel Test Generator

Auto generate the unit test file for the available routes

Installation

The package can easily be installed by running composer require vigneshc91/laravel-test-generator in your project's root folder.

If you are running a version of Laravel < 5.5 also make sure you add Vigneshc91\LaravelTestGenerator\TestGeneratorServiceProvider::class to the providers array in config/app.php.

This will register the artisan command that will be available to you.

Usage

Generating the test file is easy, simply run php artisan laravel-test:generate in your project root. This will write all the test cases into the file based on controller.

If you wish to filter for specific routes only, you can pass a filter attribute using --filter, for example php artisan laravel-test:generate --filter='/api'

If you wish to change the directory of creating the test file, you can pass a directory using --dir, for example php artisan laravel-test:generate --dir='V1'

If you wish to add the @depends attribute to all the function except the first function for running test cases synchronously, you can pass a sync attribute using --sync, for example php artisan laravel-test:generate --sync='true'

Comments