Removed API test which is no longer relevant

This commit is contained in:
Alejandro Celaya 2021-12-18 18:41:11 +01:00
parent 970f202757
commit 277d817429

View file

@ -33,26 +33,6 @@ class DeleteShortUrlTest extends ApiTestCase
self::assertEquals($domain, $payload['domain'] ?? null);
}
/** @test */
public function unprocessableEntityIsReturnedWhenTryingToDeleteUrlWithTooManyVisits(): void
{
// Generate visits first
for ($i = 0; $i < 20; $i++) {
self::assertEquals(self::STATUS_FOUND, $this->callShortUrl('abc123')->getStatusCode());
}
$expectedDetail = 'Impossible to delete short URL with short code "abc123", since it has more than "15" '
. 'visits.';
$resp = $this->callApiWithKey(self::METHOD_DELETE, '/short-urls/abc123');
$payload = $this->getJsonResponsePayload($resp);
self::assertEquals(self::STATUS_UNPROCESSABLE_ENTITY, $resp->getStatusCode());
self::assertEquals(self::STATUS_UNPROCESSABLE_ENTITY, $payload['status']);
self::assertEquals('INVALID_SHORT_URL_DELETION', $payload['type']);
self::assertEquals($expectedDetail, $payload['detail']);
self::assertEquals('Cannot delete short URL', $payload['title']);
}
/** @test */
public function properShortUrlIsDeletedWhenDomainIsProvided(): void
{