Download the PHP package endeavour-agency/laravel-migration-tests without Composer
On this page you can find all versions of the php package endeavour-agency/laravel-migration-tests. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download endeavour-agency/laravel-migration-tests
More information about endeavour-agency/laravel-migration-tests
Files in endeavour-agency/laravel-migration-tests
Package laravel-migration-tests
Short Description Provides tools for integration testing Laravel migrations.
License MIT
Homepage https://github.com/endeavour-agency/laravel-migration-tests
Informations about the package laravel-migration-tests
Laravel Migration Tests
This package provides a trait that can be used to test migrations. It allows you to specify which migration you wish to test. It will then create a fresh database, run any migrations up until the specified migration, let you do setup work, run the migration under test, and then let you do your assertions.
Example
Getting started
To get started, simply install the package.
Then use EndeavourAgency\LaravelMigrationTests\Traits\TestsLaravelMigrationsTrait
in your test class.
Important notes
Testing migrations can be extremely helpful when you are doing complicated database data or structure mutations. It also makes it possible to write your migrations in a test-driven way. However, it is advisable to delete migration tests from your test suite after the migrations have run on production, as these tests are slow of nature. This is because they need to tear down your entire database before it can run its assertions.