Skip to content

Commit 5b584d9

Browse files
authored
Added amLoggedInAs description (#57)
1 parent 7c11357 commit 5b584d9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Diff for: src/Codeception/Module/Symfony.php

+17
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,23 @@ public function dontSeeFormErrors()
12151215
);
12161216
}
12171217

1218+
/**
1219+
* Login with the given user object.
1220+
* The `$user` object must have a persistent identifier.
1221+
* If you have more than one firewall or firewall context, you can specify the desired one as a parameter.
1222+
*
1223+
* ```php
1224+
* <?php
1225+
* $user = $I->grabEntityFromRepository(User::class, [
1226+
* 'email' => '[email protected]'
1227+
* ]);
1228+
* $I->amLoggedInAs($user);
1229+
* ```
1230+
*
1231+
* @param UserInterface $user
1232+
* @param string $firewallName
1233+
* @param null $firewallContext
1234+
*/
12181235
public function amLoggedInAs(UserInterface $user, string $firewallName = 'main', $firewallContext = null)
12191236
{
12201237
$session = $this->grabService('session');

0 commit comments

Comments
 (0)