| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function testLoginWithInvalidCredentials() |
||
| 13 | { |
||
| 14 | //When we try to login passing wrong credentials |
||
| 15 | $payload = [ |
||
| 16 | 'login' => 'foo', |
||
| 17 | 'password' => 'bar', |
||
| 18 | ]; |
||
| 19 | |||
| 20 | $response = $this->json('POST', 'api/v1/backoffice/login', $payload); |
||
| 21 | |||
| 22 | // It should return an error invalid_credentials |
||
| 23 | $response |
||
| 24 | ->assertStatus(401) |
||
| 25 | ->assertJson(['error' => 'invalid_credentials']); |
||
| 26 | } |
||
| 28 |