https://github.com/andrewgatenbyvs/snap-migrations
🚀 Super-fast alternative to running database migrations (and optionally, seeds) during Tests, for Lumen & Laravel. Can save 75% of the migration (and seed) setup time, versus using the regular DatabaseMigrations trait.
https://github.com/andrewgatenbyvs/snap-migrations
database-migrations integration-testing laravel lumen lumen-package lumen-php-framework php-library phpunit phpunit-util unit-testing
Last synced: 3 months ago
JSON representation
🚀 Super-fast alternative to running database migrations (and optionally, seeds) during Tests, for Lumen & Laravel. Can save 75% of the migration (and seed) setup time, versus using the regular DatabaseMigrations trait.
- Host: GitHub
- URL: https://github.com/andrewgatenbyvs/snap-migrations
- Owner: AndrewGatenbyVS
- Created: 2019-05-23T15:57:34.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-09-13T10:56:49.000Z (almost 2 years ago)
- Last Synced: 2025-01-16T20:13:50.273Z (5 months ago)
- Topics: database-migrations, integration-testing, laravel, lumen, lumen-package, lumen-php-framework, php-library, phpunit, phpunit-util, unit-testing
- Language: PHP
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://codeclimate.com/github/AndrewGatenbyVS/snap-migrations)
[](https://codeclimate.com/github/AndrewGatenbyVS/snap-migrations)
[](https://github.com/AndrewGatenbyVS/snap-migrations/commits/master)

# Snap Migrations (for Lumen & Laravel)
This package is designed to be used within your TestCase class and allows for Lumen & 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 the package via Composer:
```
composer require --dev andrewgatenby/snapmigrations
```## 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:```php
setUpSnapMigrations();
// my regular setUp tasks for MyAmazingTestCase
}
}
```## Credit
This package was inspired by the awesome looking [Snipe Migrations](https://github.com/drfraker/snipe-migrations) that I'd tried to make use of first, but needed a Lumen-friendly implementation. It also uses the excellent
[MySQL Dump](https://github.com/dg/MySQL-dump) package.