Created API tests for errors when resolving short URLs

This commit is contained in:
Alejandro Celaya
2019-11-20 20:44:03 +01:00
parent 9096318968
commit d044e1a5b7
6 changed files with 24 additions and 49 deletions

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace ShlinkioApiTest\Shlink\Rest\Action;
use Shlinkio\Shlink\Rest\Util\RestUtils;
use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase;
class ResolveShortUrlActionTest extends ApiTestCase
{
/** @test */
public function tryingToResolveInvalidUrlReturnsNotFoundError(): void
{
$resp = $this->callApiWithKey(self::METHOD_GET, '/short-urls/invalid');
['error' => $error] = $this->getJsonResponsePayload($resp);
$this->assertEquals(self::STATUS_NOT_FOUND, $resp->getStatusCode());
$this->assertEquals(RestUtils::INVALID_ARGUMENT_ERROR, $error);
}
}