mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Created API tests for errors when getting short URL visits
This commit is contained in:
21
module/Rest/test-api/Action/GetVisitsActionTest.php
Normal file
21
module/Rest/test-api/Action/GetVisitsActionTest.php
Normal 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 GetVisitsActionTest extends ApiTestCase
|
||||
{
|
||||
/** @test */
|
||||
public function tryingToGetVisitsForInvalidUrlReturnsNotFoundError(): void
|
||||
{
|
||||
$resp = $this->callApiWithKey(self::METHOD_GET, '/short-urls/invalid/visits');
|
||||
['error' => $error] = $this->getJsonResponsePayload($resp);
|
||||
|
||||
$this->assertEquals(self::STATUS_NOT_FOUND, $resp->getStatusCode());
|
||||
$this->assertEquals(RestUtils::INVALID_ARGUMENT_ERROR, $error);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user