2020-05-01 12:40:02 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace ShlinkioApiTest\Shlink\Rest\Action;
|
|
|
|
|
|
|
|
use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase;
|
|
|
|
|
|
|
|
class GlobalVisitsActionTest extends ApiTestCase
|
|
|
|
{
|
|
|
|
/** @test */
|
|
|
|
public function returnsExpectedVisitsStats(): void
|
|
|
|
{
|
|
|
|
$resp = $this->callApiWithKey(self::METHOD_GET, '/visits');
|
|
|
|
$payload = $this->getJsonResponsePayload($resp);
|
|
|
|
|
2020-10-04 01:35:14 +03:00
|
|
|
self::assertArrayHasKey('visits', $payload);
|
|
|
|
self::assertArrayHasKey('visitsCount', $payload['visits']);
|
|
|
|
self::assertEquals(7, $payload['visits']['visitsCount']);
|
2020-05-01 12:40:02 +03:00
|
|
|
}
|
|
|
|
}
|