Improved api tests where a short URL needs to be resolved, covering cases where API key lacks permissions

This commit is contained in:
Alejandro Celaya
2021-01-10 09:02:05 +01:00
parent f17873b527
commit ea05259bbe
6 changed files with 37 additions and 13 deletions

View File

@@ -50,9 +50,10 @@ class ResolveShortUrlActionTest extends ApiTestCase
public function tryingToResolveInvalidUrlReturnsNotFoundError(
string $shortCode,
?string $domain,
string $expectedDetail
string $expectedDetail,
string $apiKey
): void {
$resp = $this->callApiWithKey(self::METHOD_GET, $this->buildShortUrlPath($shortCode, $domain));
$resp = $this->callApiWithKey(self::METHOD_GET, $this->buildShortUrlPath($shortCode, $domain), [], $apiKey);
$payload = $this->getJsonResponsePayload($resp);
self::assertEquals(self::STATUS_NOT_FOUND, $resp->getStatusCode());