Skip to content

Commit

Permalink
fix: remove WithWorkbench Trait (not available for laravel 9)
Browse files Browse the repository at this point in the history
  • Loading branch information
mckenziearts committed Jul 24, 2024
1 parent 597afdd commit 91e889c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
27 changes: 27 additions & 0 deletions tests/database/migrations/create_users_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

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');
}
};
8 changes: 4 additions & 4 deletions tests/src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@

use Illuminate\Foundation\Testing\LazilyRefreshDatabase;
use Laravelcm\Subscriptions\SubscriptionServiceProvider;
use Orchestra\Testbench\Concerns\WithWorkbench;
use Orchestra\Testbench\TestCase as BaseTestCase;
use Tests\Models\User;

abstract class TestCase extends BaseTestCase
{
use LazilyRefreshDatabase;
use WithWorkbench;

protected function getPackageProviders($app): array
{
Expand All @@ -24,8 +22,10 @@ protected function getPackageProviders($app): array

protected function defineDatabaseMigrations(): void
{
$this->loadLaravelMigrations();
$this->loadMigrationsFrom(__DIR__.'/../../database/migrations');
$this->loadMigrationsFrom([
__DIR__.'/../database/migrations',
__DIR__.'/../../database/migrations',
]);
}

protected function getEnvironmentSetUp($app): void
Expand Down

0 comments on commit 91e889c

Please sign in to comment.