code-distortion / adapt
A Laravel package that builds databases for your tests, improving their speed.
Installs: 28 423
Dependents: 0
Suggesters: 0
Security: 0
Stars: 24
Watchers: 2
Forks: 3
Open Issues: 4
Requires
- php: 7.0.* | 7.1.* | 7.2.* | 7.3.* | 7.4.* | 8.0.* | 8.1.* | 8.2.* | 8.3.*
- ext-json: *
- ext-mbstring: *
- ext-pdo: *
- code-distortion/fluent-dotenv: ^0.3.3
- guzzlehttp/guzzle: ^6.3 | ^7.0
- vlucas/phpdotenv: ^1.1 | ^2.0 | ^3.0 | ^4.0 | ^5.0
Requires (Dev)
- fakerphp/faker: ^1.0
- infection/infection: ^0.10 | ^0.11 | ^0.12 | ^0.13 | ^0.14 | ^0.15 | ^0.16 | ^0.17 | ^0.18 | ^0.19 | ^0.20 | ^0.21 | ^0.22 | ^0.23 | ^0.24 | ^0.25 | ^0.26 | ^0.27 | ^0.28 | ^0.29
- orchestra/testbench: ^3.2 | ^4.0 | ^5.0 | ^6.0 | ^7.0 | ^8.0 | ^9.0
- phpstan/phpstan: ^0.7 | ^0.8 | ^0.9 | ^0.10 | ^0.11 | ^0.12 | ^1.0
- phpunit/phpunit: ~4.8 | ^5.0 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0
- squizlabs/php_codesniffer: ^3.10
- dev-master
- 0.12.12
- 0.12.11
- 0.12.10
- 0.12.9
- 0.12.8
- 0.12.7
- 0.12.6
- 0.12.5
- 0.12.4
- 0.12.3
- 0.12.1
- 0.12.0
- 0.11.1
- 0.11.0
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.0
- 0.7.0
- 0.6.7
- 0.6.6
- 0.6.5
- 0.6.4
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-master-test
- dev-latest-test
- dev-latest
This package is auto-updated.
Last update: 2024-11-15 06:10:58 UTC
README
code-distortion/adapt is a package for Laravel that builds databases for your tests.
Features
- 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 MySQL) 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.
Documentation
The documentation for this package has a its own dedicated page. Please look there for details on how to install and configure Adapt.
Changelog
Please see CHANGELOG for more information on what has changed recently.
SemVer
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.
Testing
composer test
Treeware
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.
Contributing
Please see CONTRIBUTING for details.
Code of Conduct
Please see CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email tim@code-distortion.net instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.