Completed
Pull Request — master (#554)
by Alejandro
05:47
created

GetVisitsActionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A tryingToGetVisitsForInvalidUrlReturnsNotFoundError() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ShlinkioApiTest\Shlink\Rest\Action;
6
7
use Shlinkio\Shlink\Rest\Util\RestUtils;
8
use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase;
9
10
class GetVisitsActionTest extends ApiTestCase
11
{
12
    /** @test */
13
    public function tryingToGetVisitsForInvalidUrlReturnsNotFoundError(): void
14
    {
15
        $resp = $this->callApiWithKey(self::METHOD_GET, '/short-urls/invalid/visits');
16
        ['error' => $error] = $this->getJsonResponsePayload($resp);
17
18
        $this->assertEquals(self::STATUS_NOT_FOUND, $resp->getStatusCode());
19
        $this->assertEquals(RestUtils::INVALID_ARGUMENT_ERROR, $error);
20
    }
21
}
22