diff --git a/src/Codeception/Module/Laravel/InteractsWithAuthentication.php b/src/Codeception/Module/Laravel/InteractsWithAuthentication.php index 1e1ee27..a6beedc 100644 --- a/src/Codeception/Module/Laravel/InteractsWithAuthentication.php +++ b/src/Codeception/Module/Laravel/InteractsWithAuthentication.php @@ -12,6 +12,11 @@ trait InteractsWithAuthentication { /** * Set the given user object to the current or specified Guard. + * + * ```php + * 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 + * 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 + * assertCredentials([ + * 'email' => 'john_doe@gmail.com', + * '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 + * assertInvalidCredentials([ + * 'email' => 'john_doe@gmail.com', + * '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 + * dontSeeAuthentication(); + * ``` */ public function dontSeeAuthentication(string $guardName = null): void { @@ -106,6 +137,11 @@ public function dontSeeAuthentication(string $guardName = null): void /** * Logout user. + * + * ```php + * logout(); + * ``` */ public function logout(): void { @@ -114,6 +150,11 @@ public function logout(): void /** * Checks that a user is authenticated. + * + * ```php + * seeAuthentication(); + * ``` */ public function seeAuthentication(string $guardName = null): void { diff --git a/src/Codeception/Module/Laravel/InteractsWithContainer.php b/src/Codeception/Module/Laravel/InteractsWithContainer.php index aa2589a..8bbec1e 100644 --- a/src/Codeception/Module/Laravel/InteractsWithContainer.php +++ b/src/Codeception/Module/Laravel/InteractsWithContainer.php @@ -23,6 +23,11 @@ public function clearApplicationHandlers(): void /** * Provides access the Laravel application object. + * + * ```php + * getApplication(); + * ``` */ public function getApplication(): Application { diff --git a/src/Codeception/Module/Laravel/InteractsWithSession.php b/src/Codeception/Module/Laravel/InteractsWithSession.php index 62fd560..21972c1 100644 --- a/src/Codeception/Module/Laravel/InteractsWithSession.php +++ b/src/Codeception/Module/Laravel/InteractsWithSession.php @@ -59,6 +59,11 @@ public function dontSeeSessionHasValues(array $bindings): void /** * Flush all of the current session data. + * + * ```php + * flushSession(); + * ``` */ public function flushSession(): void { @@ -68,6 +73,11 @@ public function flushSession(): void /** * Set the session to the given array. + * + * ```php + * haveInSession(['myKey' => 'MyValue']); + * ``` */ public function haveInSession(array $data): void { diff --git a/src/Codeception/Module/Laravel/MakesHttpRequests.php b/src/Codeception/Module/Laravel/MakesHttpRequests.php index 7fa04f5..52cc1be 100644 --- a/src/Codeception/Module/Laravel/MakesHttpRequests.php +++ b/src/Codeception/Module/Laravel/MakesHttpRequests.php @@ -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 * enableMiddleware(); * ``` * - * @param string|array|null $middleware + * @param string|array|null $middleware */ public function enableMiddleware($middleware = null): void {