PHPackages                             andrewgatenby/snapmigrations - 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. andrewgatenby/snapmigrations

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

andrewgatenby/snapmigrations
============================

Generates an SQL dump of your migrated (and seeded) database to save time re-running Migrations when running Integration and Acceptance Tests in a Lumen environment.

v0.11(2y ago)17.3k3PHPPHP ^7.2|^8.0

Since May 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/AndrewGatenbyVS/snap-migrations)[ Packagist](https://packagist.org/packages/andrewgatenby/snapmigrations)[ RSS](/packages/andrewgatenby-snapmigrations/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (2)Versions (12)Used By (0)

[![Code Climate maintainability](https://camo.githubusercontent.com/c2f8bafd29d2bcb583b8eb5ddd4772c5a4603d647f466560f5bfcac0b2737ab9/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792f416e64726577476174656e627956532f736e61702d6d6967726174696f6e732e737667)](https://codeclimate.com/github/AndrewGatenbyVS/snap-migrations)[![Code Climate technical debt](https://camo.githubusercontent.com/5fe493e10ea6f2508934a591c4203c4e368c43c5b4c045eb8b4e76655d1884fa/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f746563682d646562742f416e64726577476174656e627956532f736e61702d6d6967726174696f6e732e737667)](https://codeclimate.com/github/AndrewGatenbyVS/snap-migrations)[![GitHub last commit](https://camo.githubusercontent.com/dea7c06b0231b5e099a2f17cee827e29dbbe530afda27fed1970bd0b109d395b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f416e64726577476174656e627956532f736e61702d6d6967726174696f6e732e737667)](https://github.com/AndrewGatenbyVS/snap-migrations/commits/master)[![PHP from Packagist](https://camo.githubusercontent.com/27eaa3bf2fb3012649423621171b2f7a0c3308fc673e645f0fdbf7a8f485cc64/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f616e64726577676174656e62792f736e61706d6967726174696f6e732e737667)](https://camo.githubusercontent.com/27eaa3bf2fb3012649423621171b2f7a0c3308fc673e645f0fdbf7a8f485cc64/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f616e64726577676174656e62792f736e61706d6967726174696f6e732e737667)[![Packagist](https://camo.githubusercontent.com/962c77a80e84344cab7d01c0c714dfb713ed8b92ac4e127015f9c37335068b57/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64642f416e64726577476174656e62792f736e61706d6967726174696f6e732e7376673f636f6c6f723d303063633030267374796c653d666c6174)](https://camo.githubusercontent.com/962c77a80e84344cab7d01c0c714dfb713ed8b92ac4e127015f9c37335068b57/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64642f416e64726577476174656e62792f736e61706d6967726174696f6e732e7376673f636f6c6f723d303063633030267374796c653d666c6174)

Snap Migrations (for Lumen &amp; Laravel)
=========================================

[](#snap-migrations-for-lumen--laravel)

This package is designed to be used within your TestCase class and allows for Lumen &amp; Laravel applications to create a static SQL dump of a migrated (and seeded) database. It will automatically do this on the first Test run from a TestCase that uses this Trait. Each subsequent Test run will then use the SQL dumped copy of the database.

Install
-------

[](#install)

Install the package via Composer:

```
composer require --dev andrewgatenby/snapmigrations

```

Usage
-----

[](#usage)

After a successful installation, you can add `SnapMigration` to your Test classes (potentially a parent class). This package is designed to *replace* the regular `DatabaseMigrations` class that you might use:

```
