-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d13e25
commit 91e812b
Showing
4 changed files
with
58 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,11 @@ trait InteractsWithAuthentication | |
{ | ||
/** | ||
* Set the given user object to the current or specified Guard. | ||
* | ||
* ```php | ||
* <?php | ||
* $I->amActingAs($user); | ||
* ``` | ||
*/ | ||
public function amActingAs(Authenticatable $user, string $guardName = null): void | ||
{ | ||
|
@@ -58,6 +63,11 @@ public function amLoggedAs($user, string $guardName = null): void | |
|
||
/** | ||
* Assert that the user is authenticated as the given user. | ||
* | ||
* ```php | ||
* <?php | ||
* $I->assertAuthenticatedAs($user); | ||
* ``` | ||
*/ | ||
public function assertAuthenticatedAs(Authenticatable $user, string $guardName = null): void | ||
{ | ||
|
@@ -78,6 +88,14 @@ public function assertAuthenticatedAs(Authenticatable $user, string $guardName = | |
|
||
/** | ||
* Assert that the given credentials are valid. | ||
* | ||
* ```php | ||
* <?php | ||
* $I->assertCredentials([ | ||
* 'email' => '[email protected]', | ||
* 'password' => '123456' | ||
* ]); | ||
* ``` | ||
*/ | ||
public function assertCredentials(array $credentials, string $guardName = null): void | ||
{ | ||
|
@@ -88,6 +106,14 @@ public function assertCredentials(array $credentials, string $guardName = null): | |
|
||
/** | ||
* Assert that the given credentials are invalid. | ||
* | ||
* ```php | ||
* <?php | ||
* $I->assertInvalidCredentials([ | ||
* 'email' => '[email protected]', | ||
* 'password' => 'wrong_password' | ||
* ]); | ||
* ``` | ||
*/ | ||
public function assertInvalidCredentials(array $credentials, string $guardName = null): void | ||
{ | ||
|
@@ -98,6 +124,11 @@ public function assertInvalidCredentials(array $credentials, string $guardName = | |
|
||
/** | ||
* Check that user is not authenticated. | ||
* | ||
* ```php | ||
* <?php | ||
* $I->dontSeeAuthentication(); | ||
* ``` | ||
*/ | ||
public function dontSeeAuthentication(string $guardName = null): void | ||
{ | ||
|
@@ -106,6 +137,11 @@ public function dontSeeAuthentication(string $guardName = null): void | |
|
||
/** | ||
* Logout user. | ||
* | ||
* ```php | ||
* <?php | ||
* $I->logout(); | ||
* ``` | ||
*/ | ||
public function logout(): void | ||
{ | ||
|
@@ -114,6 +150,11 @@ public function logout(): void | |
|
||
/** | ||
* Checks that a user is authenticated. | ||
* | ||
* ```php | ||
* <?php | ||
* $I->seeAuthentication(); | ||
* ``` | ||
*/ | ||
public function seeAuthentication(string $guardName = null): void | ||
{ | ||
|
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