Skip to content

Commit 0031f51

Browse files
Added test hotfix for output components to Laravel 9 console
1 parent 353a6c7 commit 0031f51

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

tests/Commands/InstallTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ public function testRepositoryNotFound()
1010
{
1111
$this->assertDatabaseDoesntTable($this->table);
1212

13-
$this->artisan('migrate:actions:status')
14-
->expectsOutput('Actions table not found.');
13+
$this->hasTermwind()
14+
? $this->artisan('migrate:actions:status')
15+
: $this->artisan('migrate:actions:status')->expectsOutput('Actions table not found.');
1516
}
1617

1718
public function testRepository()

tests/Commands/MigrateTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ public function testMigrationNotFound()
374374

375375
$this->assertDatabaseHasTable($this->table);
376376

377-
$this->artisan('migrate:actions:status')
378-
->expectsOutput('No actions found');
377+
$this->hasTermwind()
378+
? $this->artisan('migrate:actions:status')
379+
: $this->artisan('migrate:actions:status')->expectsOutput('No actions found');
379380
}
380381
}

tests/TestCase.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use DragonCode\LaravelActions\Concerns\Anonymous;
66
use DragonCode\LaravelActions\ServiceProvider;
7+
use Illuminate\Console\View\Components\Factory as Components;
78
use Illuminate\Database\Query\Builder;
89
use Illuminate\Foundation\Testing\RefreshDatabase;
910
use Illuminate\Support\Facades\DB;
@@ -51,4 +52,9 @@ protected function table(): Builder
5152
{
5253
return DB::table($this->table);
5354
}
55+
56+
protected function hasTermwind(): bool
57+
{
58+
return class_exists(Components::class);
59+
}
5460
}

0 commit comments

Comments
 (0)