code-distortion/adapt is a package for Laravel that builds databases for your tests.
- Adapt is a swap-in replacement for Laravel's
RefreshDatabase
,DatabaseMigrations
, andDatabaseTransactions
traits. - To get the best speeds, your databases are reused (when possible) each time you run your tests.
- A new (experimental) journaling method for reusing databases. This is an alternative for when transactions can't be used (like when browser testing).
- You don't need to create empty databases beforehand. They're created automatically.
- There's no need to drop or rebuild databases yourself. They are automatically rebuilt when you change your migrations, seeders or factories.
- Lets you import custom sql-dump files before running your migrations.
- Your tests can use different seeders for different tests, without them needing to be re-run each time.
- You can include Dusk browser tests in your normal test run - there's no need to run
php artisan dusk
separately. - You can run your tests in parallel, separate databases are created for each process.
- You can also run Dusk browser tests in parallel.
- If your project has more than one database, you can build them as well. Each with their own migrations and seeders.
- If you have two or more Laravel codebases in your project, you can have one build databases for the others.
The documentation for this package has a its own dedicated page. Please look there for details on how to install and configure Adapt.
Please see CHANGELOG for more information on what has changed recently.
This library uses SemVer 2.0.0 versioning. This means that changes to X
indicate a breaking change: 0.0.X
, 0.X.y
, X.y.z
. When this library changes to version 1.0.0, 2.0.0 and so forth, it doesn't indicate that it's necessarily a notable release, it simply indicates that the changes were breaking.
composer test
This package is Treeware. If you use it in tests of a production project, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
Please see CONTRIBUTING for details.
Please see CODE_OF_CONDUCT for details.
If you discover any security related issues, please email tim@code-distortion.net instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.