ezitisitis / laravel-refresh-database-once
This package is abandoned and no longer maintained.
No replacement package was suggested.
Package info
github.com/ezitisitis/laravel-refresh-database-once
pkg:composer/ezitisitis/laravel-refresh-database-once
1.2.1
2025-03-10 19:50 UTC
Requires
- php: ^8.2
- laravel/framework: ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
This package is auto-updated.
Last update: 2025-03-10 19:54:03 UTC
README
⚠️ Notice: This project is no longer maintained. As a replacement please use RefreshDatabase.
This package contains Trait to refresh and seed database before running test scope.
Why do you need that
When you work in local environment. It sometimes appears that you want to run tests agains clean database (for example you have record count somewhere in tests). Running each test on clear database is bad idea in general, because:
- You check only that your code works only when there is no records;
- It is insanely time consuming;
Installing
composer require --dev ezitisitis/laravel-refresh-database-once;- Add
MigrateFreshSeedOnceuse toTestCaseclass; - Congratulations, you are done.
Example:
<?php namespace Tests; use EzitisItIs\LaravelRefreshDatabaseOnce\MigrateFreshSeedOnce use Illuminate\Foundation\Testing\TestCase as BaseTestCase; abstract class TestCase extends BaseTestCase { use CreatesApplication; use MigrateFreshSeedOnce; }