| Total Complexity | 5 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | trait Authentication |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @return static |
||
| 16 | */ |
||
| 17 | public function loginAs(string $username, string $password): self |
||
| 18 | { |
||
| 19 | return $this |
||
| 20 | ->visit('/login') |
||
|
|
|||
| 21 | ->fillField('email', $username) |
||
| 22 | ->fillField('password', $password) |
||
| 23 | ->click('Login') |
||
| 24 | ; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @return static |
||
| 29 | */ |
||
| 30 | public function logout(): self |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @return static |
||
| 37 | */ |
||
| 38 | public function assertLoggedIn(): self |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return static |
||
| 47 | */ |
||
| 48 | public function assertLoggedInAs(string $user): self |
||
| 49 | { |
||
| 50 | $this->assertSee($user); |
||
| 51 | |||
| 52 | return $this; |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @return static |
||
| 57 | */ |
||
| 58 | public function assertNotLoggedIn(): self |
||
| 63 | } |
||
| 64 | } |
||
| 65 |