mirror of
https://github.com/filamentphp/filament.git
synced 2026-08-29 03:09:12 +08:00
Use Testbench configuration feature
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
migrations:
|
||||
- tests/database/migrations
|
||||
|
||||
workbench:
|
||||
install: true
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class() extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('password_reset_tokens', function (Blueprint $table): void {
|
||||
$table->string('email')->index();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('password_reset_tokens');
|
||||
}
|
||||
};
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class() extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
}
|
||||
};
|
||||
@@ -17,12 +17,14 @@ use Filament\Tests\Models\User;
|
||||
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 @@ abstract class TestCase extends BaseTestCase
|
||||
];
|
||||
}
|
||||
|
||||
protected function defineDatabaseMigrations(): void
|
||||
{
|
||||
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user