-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Testbench configuration feature #11595
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
migrations: | ||
- tests/database/migrations | ||
|
||
workbench: | ||
install: true | ||
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,12 +17,14 @@ | |
use Filament\Widgets\WidgetsServiceProvider; | ||
use Illuminate\Foundation\Testing\LazilyRefreshDatabase; | ||
use Livewire\LivewireServiceProvider; | ||
use Orchestra\Testbench\Concerns\WithWorkbench; | ||
use Orchestra\Testbench\TestCase as BaseTestCase; | ||
use RyanChandler\BladeCaptureDirective\BladeCaptureDirectiveServiceProvider; | ||
|
||
abstract class TestCase extends BaseTestCase | ||
{ | ||
use LazilyRefreshDatabase; | ||
use WithWorkbench; | ||
|
||
protected function getPackageProviders($app): array | ||
{ | ||
|
@@ -49,12 +51,7 @@ protected function getPackageProviders($app): array | |
]; | ||
} | ||
|
||
protected function defineDatabaseMigrations(): void | ||
{ | ||
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using this causes Laravel to migrate the database twice, using Using |
||
} | ||
|
||
protected function getEnvironmentSetUp($app): void | ||
protected function defineEnvironment($app): void | ||
{ | ||
$app['config']->set('auth.passwords.users.table', 'password_reset_tokens'); | ||
$app['config']->set('auth.providers.users.model', User::class); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having
install: true
andmigrations
other thanfalse
will migrate the default laravel migrations. Which means we no longer requirescreate_password_reset_tokens_table
andcreate_users_table
.