Skip to content

Commit

Permalink
Remove test route inside service provider
Browse files Browse the repository at this point in the history
  • Loading branch information
metallurgical committed Mar 31, 2020
1 parent 412d154 commit 636f754
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 0 additions & 2 deletions src/ApiKeyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public function boot(Filesystem $filesystem)
__DIR__ . '/../database/migrations/create_api_keys_table.php.stub' => $this->getMigrationFileName($filesystem),
], 'migrations');

$this->loadRoutesFrom(__DIR__ . '/../tests/TestRoute/TestRoute.php');

Auth::extend('api_key', function ($app, $name, array $config) {
// Automatically build the DI, put it as reference
$userProvider = app(UserTokenProvider::class);
Expand Down
11 changes: 11 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ public function setUp(): void
$this->withFactories(__DIR__ . '/../database/factories');

$this->setUpDatabase($this->app);

/** @var \Illuminate\Routing\Router $router */
$router = $this->app['router'];

$router->get('/authorize/user', function () {
return request()->user();
})->middleware('auth:api_key');

$router->get('/unauthorized/user', function () {
return request()->user();
})->middleware('auth:api_key');
}

protected function getPackageProviders($app)
Expand Down
11 changes: 0 additions & 11 deletions tests/TestRoute/TestRoute.php

This file was deleted.

0 comments on commit 636f754

Please sign in to comment.