| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 45 | public function testLogin(): void |
||
| 46 | { |
||
| 47 | $result = $this->get('/auth/login'); |
||
| 48 | |||
| 49 | $this->assertSame('OK', (string)$result->getBody()); |
||
| 50 | |||
| 51 | $cookies = $this->fetchCookies($result->getHeader('Set-Cookie')); |
||
| 52 | $this->assertTrue(isset($cookies['token'])); |
||
| 53 | |||
| 54 | $token = $this->app->get(ORMInterface::class)->getRepository(Token::class)->findOne(); |
||
| 55 | $this->assertSame(['userID' => 1], $token->getPayload()); |
||
| 56 | |||
| 57 | $result = $this->get('/auth/token', [], [], $cookies); |
||
| 58 | |||
| 59 | $this->assertNotSame('none', (string)$result->getBody()); |
||
| 60 | } |
||
| 62 |