Skip to content

Commit

Permalink
Revert Test | Remove L5.8 GH Test
Browse files Browse the repository at this point in the history
  • Loading branch information
dbpolito committed Mar 20, 2020
1 parent abe7362 commit d2c0604
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
php: [7.3, 7.4]
laravel: [5.8.*, 6.*, 7.*]
laravel: [6.*, 7.*]
dependency-version: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
Expand Down
25 changes: 8 additions & 17 deletions tests/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Fireworkweb\Gates\Middlewares\Gate;
use Fireworkweb\Gates\Tests\Policies\PolicyWithGates;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Str;

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

$exitCode = Artisan::call('gates:routes-without-gate', [
$this->artisan('gates:routes-without-gate', [
'middleware' => Gate::class,
]);

$output = Artisan::output();

$this->assertSame(0, $exitCode);
$this->assertTrue(Str::contains($output, 'Great job, no routes without gate. :)'));
])
->expectsOutput('Great job, no routes without gate. :)')
->assertExitCode(0);
}

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

$exitCode = Artisan::call('gates:routes-without-gate', [
$this->artisan('gates:routes-without-gate', [
'middleware' => Gate::class,
]);

$output = Artisan::output();

$this->assertSame(1, $exitCode);
$this->assertTrue(Str::contains($output, 'You got routes without gate, see list below:'));
$this->assertTrue(Str::contains($output, 'something.index'));
])
->expectsOutput('You got routes without gate, see list below:')
->assertExitCode(1);
}
}

0 comments on commit d2c0604

Please sign in to comment.