Skip to content

Commit d2c0604

Browse files
committed
Revert Test | Remove L5.8 GH Test
1 parent abe7362 commit d2c0604

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
matrix:
1111
os: [ubuntu-latest, windows-latest]
1212
php: [7.3, 7.4]
13-
laravel: [5.8.*, 6.*, 7.*]
13+
laravel: [6.*, 7.*]
1414
dependency-version: [prefer-lowest, prefer-stable]
1515

1616
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

tests/CommandTest.php

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

55
use Fireworkweb\Gates\Middlewares\Gate;
66
use Fireworkweb\Gates\Tests\Policies\PolicyWithGates;
7-
use Illuminate\Support\Facades\Artisan;
8-
use Illuminate\Support\Str;
97

108
class CommandTest extends TestCase
119
{
@@ -23,14 +21,11 @@ public function it_can_see_all_routes_with_gate()
2321
return 'yay';
2422
})->name('policy.accept')->middleware(Gate::class);
2523

26-
$exitCode = Artisan::call('gates:routes-without-gate', [
24+
$this->artisan('gates:routes-without-gate', [
2725
'middleware' => Gate::class,
28-
]);
29-
30-
$output = Artisan::output();
31-
32-
$this->assertSame(0, $exitCode);
33-
$this->assertTrue(Str::contains($output, 'Great job, no routes without gate. :)'));
26+
])
27+
->expectsOutput('Great job, no routes without gate. :)')
28+
->assertExitCode(0);
3429
}
3530

3631
/** @test */
@@ -40,14 +35,10 @@ public function it_can_see_a_route_without_gate()
4035
return 'yay';
4136
})->name('something.index')->middleware(Gate::class);
4237

43-
$exitCode = Artisan::call('gates:routes-without-gate', [
38+
$this->artisan('gates:routes-without-gate', [
4439
'middleware' => Gate::class,
45-
]);
46-
47-
$output = Artisan::output();
48-
49-
$this->assertSame(1, $exitCode);
50-
$this->assertTrue(Str::contains($output, 'You got routes without gate, see list below:'));
51-
$this->assertTrue(Str::contains($output, 'something.index'));
40+
])
41+
->expectsOutput('You got routes without gate, see list below:')
42+
->assertExitCode(1);
5243
}
5344
}

0 commit comments

Comments
 (0)