Skip to content

Commit

Permalink
refactor: relocate test migrations to workbench
Browse files Browse the repository at this point in the history
  • Loading branch information
czernika committed Mar 19, 2024
1 parent 068c265 commit 6122624
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
"psr-4": {
"Tests\\": "tests/",
"App\\": "vendor/orchestra/testbench-core/laravel/app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/",
"Workbench\\App\\": "workbench/app/",
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
Expand Down
8 changes: 4 additions & 4 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
use Orchid\Support\Facades\Alert;
use Tabuna\Breadcrumbs\Breadcrumbs;
use Watson\Active\Active;
use Orchestra\Testbench\Attributes\WithMigration;

#[WithMigration]
use function Orchestra\Testbench\workbench_path;

abstract class TestCase extends BaseTestCase
{
use WithWorkbench, InteractsWithViews, RefreshDatabase;
Expand All @@ -30,7 +30,7 @@ protected function setUp(): void
Factory::guessFactoryNamesUsing(function ($factory) {
$factoryBasename = class_basename($factory);

return "Database\Factories\\$factoryBasename".'Factory';
return "Workbench\\Database\Factories\\$factoryBasename".'Factory';
});

// Use our test mockup model instead
Expand All @@ -53,7 +53,7 @@ protected function getPackageAliases($app): array
protected function defineDatabaseMigrations()
{
$this->loadLaravelMigrations();
$this->loadMigrationsFrom(dirname(__DIR__, 1) . '/database/migrations');
$this->loadMigrationsFrom(workbench_path('database/migrations'));
$this->artisan('orchid:install');
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Database\Factories;
namespace Workbench\Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;
use Tests\Models\Attachment;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Database\Factories;
namespace Workbench\Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;
use Tests\Models\AttachmentWithPlaceholder;
Expand Down

0 comments on commit 6122624

Please sign in to comment.