Skip to content

Commit

Permalink
add missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TavoNiievez committed Sep 10, 2021
1 parent 6d13e25 commit 91e812b
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 2 deletions.
41 changes: 41 additions & 0 deletions src/Codeception/Module/Laravel/InteractsWithAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand All @@ -106,6 +137,11 @@ public function dontSeeAuthentication(string $guardName = null): void

/**
* Logout user.
*
* ```php
* <?php
* $I->logout();
* ```
*/
public function logout(): void
{
Expand All @@ -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
{
Expand Down
5 changes: 5 additions & 0 deletions src/Codeception/Module/Laravel/InteractsWithContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ public function clearApplicationHandlers(): void

/**
* Provides access the Laravel application object.
*
* ```php
* <?php
* $app = $I->getApplication();
* ```
*/
public function getApplication(): Application
{
Expand Down
10 changes: 10 additions & 0 deletions src/Codeception/Module/Laravel/InteractsWithSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ public function dontSeeSessionHasValues(array $bindings): void

/**
* Flush all of the current session data.
*
* ```php
* <?php
* $I->flushSession();
* ```
*/
public function flushSession(): void
{
Expand All @@ -68,6 +73,11 @@ public function flushSession(): void

/**
* Set the session to the given array.
*
* ```php
* <?php
* $I->haveInSession(['myKey' => 'MyValue']);
* ```
*/
public function haveInSession(array $data): void
{
Expand Down
4 changes: 2 additions & 2 deletions src/Codeception/Module/Laravel/MakesHttpRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ public function disableMiddleware($middleware = null): void
}

/**
* Enable the given middleware for the test.
* Enable the given middleware for the next requests.
*
* ```php
* <?php
* $I->enableMiddleware();
* ```
*
* @param string|array|null $middleware
* @param string|array|null $middleware
*/
public function enableMiddleware($middleware = null): void
{
Expand Down

0 comments on commit 91e812b

Please sign in to comment.