Skip to content

Commit 91e889c

Browse files
committed
fix: remove WithWorkbench Trait (not available for laravel 9)
1 parent 597afdd commit 91e889c

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Illuminate\Database\Migrations\Migration;
6+
use Illuminate\Database\Schema\Blueprint;
7+
use Illuminate\Support\Facades\Schema;
8+
9+
return new class () extends Migration {
10+
public function up(): void
11+
{
12+
Schema::create('users', function (Blueprint $table): void {
13+
$table->id();
14+
$table->string('name');
15+
$table->string('email')->unique();
16+
$table->timestamp('email_verified_at')->nullable();
17+
$table->string('password');
18+
$table->rememberToken();
19+
$table->timestamps();
20+
});
21+
}
22+
23+
public function down(): void
24+
{
25+
Schema::dropIfExists('users');
26+
}
27+
};

tests/src/TestCase.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66

77
use Illuminate\Foundation\Testing\LazilyRefreshDatabase;
88
use Laravelcm\Subscriptions\SubscriptionServiceProvider;
9-
use Orchestra\Testbench\Concerns\WithWorkbench;
109
use Orchestra\Testbench\TestCase as BaseTestCase;
1110
use Tests\Models\User;
1211

1312
abstract class TestCase extends BaseTestCase
1413
{
1514
use LazilyRefreshDatabase;
16-
use WithWorkbench;
1715

1816
protected function getPackageProviders($app): array
1917
{
@@ -24,8 +22,10 @@ protected function getPackageProviders($app): array
2422

2523
protected function defineDatabaseMigrations(): void
2624
{
27-
$this->loadLaravelMigrations();
28-
$this->loadMigrationsFrom(__DIR__.'/../../database/migrations');
25+
$this->loadMigrationsFrom([
26+
__DIR__.'/../database/migrations',
27+
__DIR__.'/../../database/migrations',
28+
]);
2929
}
3030

3131
protected function getEnvironmentSetUp($app): void

0 commit comments

Comments
 (0)