PHPackages                             socialengine/setup-test-db - 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. socialengine/setup-test-db

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

socialengine/setup-test-db
==========================

Get efficient with seeding your database for tests in Laravel

2.0(10y ago)914.1k2[1 PRs](https://github.com/SocialEngine/setup-test-db/pulls)MITPHPPHP &gt;=5.4.0

Since Jan 2Pushed 9y ago6 watchersCompare

[ Source](https://github.com/SocialEngine/setup-test-db)[ Packagist](https://packagist.org/packages/socialengine/setup-test-db)[ Docs](https://github.com/socialengine/setup-test-db)[ RSS](/packages/socialengine-setup-test-db/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (8)Used By (0)

Setup Test DB Command for Laravel
=================================

[](#setup-test-db-command-for-laravel)

[![Latest Stable Version](https://camo.githubusercontent.com/4f832a64b296b742f5a3738b514b89ef161c43274580e2bbd83e72b7cc032798/68747470733a2f2f706f7365722e707567782e6f72672f736f6369616c656e67696e652f73657475702d746573742d64622f76657273696f6e2e706e67)](https://packagist.org/packages/socialengine/setup-test-db) [![License](https://camo.githubusercontent.com/7a3824add00bce98cfd6d591b122ba031182ed90d94031144c5b8ef67297ff24/68747470733a2f2f706f7365722e707567782e6f72672f736f6369616c656e67696e652f73657475702d746573742d64622f6c6963656e73652e737667)](https://packagist.org/packages/socialengine/setup-test-db)

Integration tests in laravel are great, but the common way to maintain the database is a giant time sink of re-seeding and re-migrating for every single test.

This command and bootstrap file aims to remove the needless reseeding and migrating (since you're using transactions anyways, right?) for every test and instead gives your tests a "clean" migrated and seeded db.

Works with `sqlite` and any others supported by Eloquent.

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

[](#installation)

Require this package in composer:

```
$ composer require socialengine/setup-test-db

```

After updating composer, add the ServiceProvider to the providers array in `app/config/app.php`.

```
'SocialEngine\TestDbSetup\ServiceProvider',

```

Add a `bootstrap/testing.php` or copy from `vendor/socialengine/setup-test-db/bootstrap/testing.php`

```
