| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public function badRequestIsReturnedWhenTryingToDeleteUrlWithTooManyVisits(): void |
||
| 24 | { |
||
| 25 | // Generate visits first |
||
| 26 | for ($i = 0; $i < 20; $i++) { |
||
| 27 | $this->assertEquals(self::STATUS_FOUND, $this->callShortUrl('abc123')->getStatusCode()); |
||
| 28 | } |
||
| 29 | |||
| 30 | $resp = $this->callApiWithKey(self::METHOD_DELETE, '/short-urls/abc123'); |
||
| 31 | ['error' => $error] = $this->getJsonResponsePayload($resp); |
||
| 32 | |||
| 33 | $this->assertEquals(self::STATUS_BAD_REQUEST, $resp->getStatusCode()); |
||
| 34 | $this->assertEquals(RestUtils::INVALID_SHORTCODE_DELETION_ERROR, $error); |
||
| 35 | } |
||
| 37 |