PHPackages                             dennislindsey/artisan-test-helpers - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. dennislindsey/artisan-test-helpers

AbandonedArchivedLibrary[Testing &amp; Quality](/categories/testing)

dennislindsey/artisan-test-helpers
==================================

PHP Artisan Test Helpers

0278PHP

Since Jan 3Pushed 9y ago1 watchersCompare

[ Source](https://github.com/dennislindsey/artisan-test-helpers)[ Packagist](https://packagist.org/packages/dennislindsey/artisan-test-helpers)[ RSS](/packages/dennislindsey-artisan-test-helpers/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Artisan Test Helpers
====================

[](#artisan-test-helpers)

This package adds 3 new `artisan` commands to your Laravel project to help make your TDD workflow a little easier:

`php artisan make:featuretest {name}`

`php artisan make:unittest {name}`

`php artisan make:factory {class}`

A Laravel service provider is also included. This provider will generate directories named `/stubs/` in your project's `/test/` and `database` directories, allowing you to customize the files that are generated by these commands.

Inspired by Adam Wathan's "Test Driven Laravel" course

Setup
-----

[](#setup)

To get started, add the package to your composer.json file, under `require-dev`:

```
"dennislindsey/artisan-test-helpers": "dev-master"

```

Once you've run a `composer update`, you need to register the Laravel service provider. You may add it to your `/config/app.php`:

```
'providers' => [
    ...
    DennisLindsey\ArtisanTestHelpers\Providers\ArtisanTestHelperServiceProvider::class,
],
```

...Or alternatively, I suggest adding the following code to your `app/Providers/AppServiceProvider.php` file, within the `register()` method:

```
public function register()
{
    if ($this->app->environment() !== 'production') {
        $this->app->register(\DennisLindsey\ArtisanTestHelpers\Providers\ArtisanTestHelperServiceProvider::class);
    }
    // ...
}
```

Make sure to publish the `stubs` directories

```
$ php artisan vendor:publish --provider="DennisLindsey\ArtisanTestHelpers\Providers\ArtisanTestHelperServiceProvider"
```

Usage
-----

[](#usage)

```
$ php artisan make:featuretest NameOfFeature
```

This will generate a file in your project's `/tests/feature/` directory called `NameOfFeatureTest.php`

```
