Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
evansims committed Apr 26, 2023
1 parent 9eb38df commit 7a24f63
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/Unit/Auth/GuardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,29 @@
use Auth0\Laravel\Exception\AuthenticationException;
use Auth0\Laravel\Entities\Credential;
use Auth0\Laravel\Model\Stateful\User;
use Auth0\SDK\Configuration\SdkConfiguration;
use Illuminate\Support\Facades\Route;

uses()->group('auth', 'auth.guard', 'auth.guard.shared');

beforeEach(function (): void {
$this->secret = uniqid();

config([
'auth0.strategy' => SdkConfiguration::STRATEGY_REGULAR,
'auth0.domain' => uniqid() . '.auth0.com',
'auth0.clientId' => uniqid(),
'auth0.clientSecret' => $this->secret,
'auth0.cookieSecret' => uniqid(),
'auth0.routes.home' => '/' . uniqid(),
]);

$this->laravel = app('auth0');
$this->guard = auth('testGuard');
$this->sdk = $this->laravel->getSdk();
$this->config = $this->sdk->configuration();
$this->session = $this->config->getSessionStorage();

$this->user = new User(['sub' => uniqid('auth0|')]);

Route::middleware('auth:auth0')->get('/test', function () {
Expand Down

0 comments on commit 7a24f63

Please sign in to comment.