Skip to content

Commit

Permalink
Merge pull request #11595 from crynobone/laravel-11
Browse files Browse the repository at this point in the history
Use Testbench configuration feature
  • Loading branch information
danharrin authored Feb 27, 2024
2 parents 060dd04 + 493d560 commit 5fc7fbe
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 56 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/.github export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/testbench.yaml export-ignore
/tests export-ignore
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"league/flysystem-aws-s3-v3": "^3.0",
"nunomaduro/termwind": "^1.0|^2.0",
"openspout/openspout": "^4.23",
"orchestra/testbench": "^8.0|^9.0",
"orchestra/testbench": "^8.20|^9.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"phpstan/extension-installer": "^1.1",
Expand Down
5 changes: 5 additions & 0 deletions testbench.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
migrations:
- tests/database/migrations

workbench:
install: true
22 changes: 0 additions & 22 deletions tests/database/migrations/create_password_reset_tokens_table.php

This file was deleted.

26 changes: 0 additions & 26 deletions tests/database/migrations/create_users_table.php

This file was deleted.

10 changes: 3 additions & 7 deletions tests/src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -49,14 +51,8 @@ protected function getPackageProviders($app): array
];
}

protected function defineDatabaseMigrations(): void
protected function defineEnvironment($app): void
{
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
}

protected function getEnvironmentSetUp($app): void
{
$app['config']->set('auth.passwords.users.table', 'password_reset_tokens');
$app['config']->set('auth.providers.users.model', User::class);
$app['config']->set('view.paths', [
...$app['config']->get('view.paths'),
Expand Down

0 comments on commit 5fc7fbe

Please sign in to comment.