2019-11-20 13:58:16 -06:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace ShlinkioApiTest\Shlink\Rest\Action;
|
|
|
|
|
|
|
|
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());
|
2019-11-26 14:29:25 -06:00
|
|
|
$this->assertEquals('INVALID_SHORTCODE', $error);
|
2019-11-20 13:58:16 -06:00
|
|
|
}
|
|
|
|
}
|