PHPackages                             davispeixoto/laravel-test-generator - 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. davispeixoto/laravel-test-generator

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

davispeixoto/laravel-test-generator
===================================

Laravel 4 tests generator

1.0.5(11y ago)51.2k3[1 issues](https://github.com/davispeixoto/Laravel-4-Test-Generator/issues)MITPHP

Since Feb 22Pushed 11y ago2 watchersCompare

[ Source](https://github.com/davispeixoto/Laravel-4-Test-Generator)[ Packagist](https://packagist.org/packages/davispeixoto/laravel-test-generator)[ RSS](/packages/davispeixoto-laravel-test-generator/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (5)Versions (7)Used By (0)

Laravel 4 Test Generator
========================

[](#laravel-4-test-generator)

[![Build Status](https://camo.githubusercontent.com/69f893fbf756ecdf278b768870f6df1eab6a407ffe2a86b605fc657525b5c7f0/68747470733a2f2f7472617669732d63692e6f72672f6461766973706569786f746f2f4c61726176656c2d342d546573742d47656e657261746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/davispeixoto/Laravel-4-Test-Generator)

This Laravel 4 package provides a powerful test generator to speed up your development process.

It's based on the facility [PHPUnit Skeleton Generator](http://phpunit.de/manual/current/en/skeleton-generator.html) provides and [Jeffrey Way's](http://jeffrey-way.com/) [Laravel 4 generators](https://github.com/JeffreyWay/Laravel-4-Generators).

The first doesn't work 100% with all Laravel 4 application classes. Usually you need to add some dependency in the class to make it work, even if your project solves it all with the [Composer](https://getcomposer.org/) [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) compliant autoloader.

The second, generates a really tiny test class. It doesn't maps all class public methods and let everything in place.

This generator loads the target with and use the PHP Reflection features for reverse engineer all public methods, and provide an enhanced skeleton, including calls for [data providers](http://phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers).

Installation
------------

[](#installation)

Begin by installing this package through Composer. Edit your project's `composer.json` file to require `davispeixoto/testingtool`.

```
"require": {
	"laravel/framework": "4.*",
	"davispeixoto/laravel-test-generator": "1.0.*"
},
"minimum-stability" : "stable"

```

Next, update Composer from the Terminal:

```
composer update

```

Once this operation completes, the final step is to add the service provider. Open `app/config/app.php`, and add a new item to the providers array.

```
'Davispeixoto\TestGenerator\TestGeneratorServiceProvider'

```

That's it! You're all set to go. Run the `artisan` command from the Terminal to see the new `tests:generate` commands.

```
php artisan

```

Usage
-----

[](#usage)

Use `tests:generate` when you need to create a new PHPUnit test class. Here's an example:

```
php artisan controller:make UserController
php artisan tests:generate UserController
```

This will generate a resource controller and a test class `app/tests/UserControllerTest.php` as follows:

```
