-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [2.x] Fixes database tests. * Apply fixes from StyleCI [ci skip] [skip ci] * [2.x] Fixes database tests. * Apply fixes from StyleCI [ci skip] [skip ci] --------- Co-authored-by: Italo <[email protected]>
- Loading branch information
1 parent
f1053f8
commit a067268
Showing
18 changed files
with
140 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,40 +8,44 @@ | |
use Laragear\WebAuthn\Assertion\Creator\AssertionCreator; | ||
use Laragear\WebAuthn\Challenge; | ||
use Laragear\WebAuthn\Enums\UserVerification; | ||
use Orchestra\Testbench\Attributes\WithMigration; | ||
use Ramsey\Uuid\Uuid; | ||
use Tests\DatabaseTestCase; | ||
use Tests\Stubs\WebAuthnAuthenticatableUser; | ||
use Tests\TestCase; | ||
|
||
use function config; | ||
use function in_array; | ||
use function now; | ||
use function session; | ||
|
||
#[WithMigration] | ||
class CreatorTest extends TestCase | ||
class CreatorTest extends DatabaseTestCase | ||
{ | ||
protected Request $request; | ||
protected WebAuthnAuthenticatableUser $user; | ||
protected AssertionCreation $creation; | ||
protected AssertionCreator $creator; | ||
|
||
protected function setUp(): void | ||
protected function defineDatabaseSeeders(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$this->request = Request::create('https://test.app/webauthn/create', 'POST'); | ||
$this->user = WebAuthnAuthenticatableUser::forceCreate([ | ||
'name' => 'test', | ||
'email' => '[email protected]', | ||
'password' => 'test_password', | ||
]); | ||
} | ||
|
||
$this->creator = new AssertionCreator($this->app); | ||
$this->creation = new AssertionCreation($this->request); | ||
protected function setUp(): void | ||
{ | ||
$this->afterApplicationCreated(function (): void { | ||
$this->request = Request::create('https://test.app/webauthn/create', 'POST'); | ||
|
||
$this->creator = new AssertionCreator($this->app); | ||
$this->creation = new AssertionCreation($this->request); | ||
|
||
$this->startSession(); | ||
$this->request->setLaravelSession($this->app->make('session.store')); | ||
$this->startSession(); | ||
$this->request->setLaravelSession($this->app->make('session.store')); | ||
}); | ||
|
||
parent::setUp(); | ||
} | ||
|
||
protected function response(): TestResponse | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,39 +10,43 @@ | |
use Laragear\WebAuthn\Challenge; | ||
use Laragear\WebAuthn\Enums\ResidentKey; | ||
use Laragear\WebAuthn\Enums\UserVerification; | ||
use Orchestra\Testbench\Attributes\WithMigration; | ||
use Ramsey\Uuid\Uuid; | ||
use Tests\DatabaseTestCase; | ||
use Tests\Stubs\WebAuthnAuthenticatableUser; | ||
use Tests\TestCase; | ||
|
||
use function config; | ||
use function now; | ||
use function session; | ||
|
||
#[WithMigration] | ||
class CreatorTest extends TestCase | ||
class CreatorTest extends DatabaseTestCase | ||
{ | ||
protected Request $request; | ||
protected WebAuthnAuthenticatableUser $user; | ||
protected AttestationCreation $creation; | ||
protected AttestationCreator $creator; | ||
|
||
protected function setUp(): void | ||
protected function defineDatabaseSeeders(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$this->request = Request::create('https://test.app/webauthn/create', 'POST'); | ||
$this->user = WebAuthnAuthenticatableUser::forceCreate([ | ||
'name' => 'test', | ||
'email' => '[email protected]', | ||
'password' => 'test_password', | ||
]); | ||
} | ||
|
||
$this->creator = new AttestationCreator($this->app); | ||
$this->creation = new AttestationCreation($this->user, $this->request); | ||
protected function setUp(): void | ||
{ | ||
$this->afterApplicationCreated(function (): void { | ||
$this->request = Request::create('https://test.app/webauthn/create', 'POST'); | ||
|
||
$this->creator = new AttestationCreator($this->app); | ||
$this->creation = new AttestationCreation($this->user, $this->request); | ||
|
||
$this->startSession(); | ||
$this->request->setLaravelSession($this->app->make('session.store')); | ||
$this->startSession(); | ||
$this->request->setLaravelSession($this->app->make('session.store')); | ||
}); | ||
|
||
parent::setUp(); | ||
} | ||
|
||
protected function response(): TestResponse | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.