Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public function testUserLogout() |
||
24 | { |
||
25 | // go to the page |
||
26 | $this->visit('login') |
||
27 | ->see('Login'); |
||
28 | |||
29 | // fill the login form |
||
30 | $this->type('[email protected]', 'email') |
||
31 | ->type('admin', 'password') |
||
32 | ->press('login'); |
||
33 | |||
34 | // login success and redirect to welcome view |
||
35 | $this->seePageIs('/dashboard') |
||
36 | ->see('Hello Admin'); |
||
37 | |||
38 | // trigger the logout request |
||
39 | $response = $this->post($this->endpoint); |
||
40 | |||
41 | $response->assertResponseStatus(302); |
||
42 | $this->assertRedirectedTo('login'); |
||
43 | $this->see('login'); |
||
44 | } |
||
45 | } |
||
46 |