Extracted ApiKey metadata to the ApiKeyMeta object

This commit is contained in:
Alejandro Celaya
2021-03-14 09:59:35 +01:00
parent 9b55389538
commit 0a5c265b12
36 changed files with 186 additions and 121 deletions

View File

@@ -30,7 +30,7 @@ class GlobalVisitsActionTest extends TestCase
/** @test */
public function statsAreReturnedFromHelper(): void
{
$apiKey = new ApiKey();
$apiKey = ApiKey::create();
$stats = new VisitsStats(5, 3);
$getStats = $this->helper->getVisitsStats($apiKey)->willReturn($stats);

View File

@@ -73,6 +73,6 @@ class ShortUrlVisitsActionTest extends TestCase
private function requestWithApiKey(): ServerRequestInterface
{
return ServerRequestFactory::fromGlobals()->withAttribute(ApiKey::class, new ApiKey());
return ServerRequestFactory::fromGlobals()->withAttribute(ApiKey::class, ApiKey::create());
}
}

View File

@@ -33,7 +33,7 @@ class TagVisitsActionTest extends TestCase
public function providingCorrectShortCodeReturnsVisits(): void
{
$tag = 'foo';
$apiKey = new ApiKey();
$apiKey = ApiKey::create();
$getVisits = $this->visitsHelper->visitsForTag($tag, Argument::type(VisitsParams::class), $apiKey)->willReturn(
new Paginator(new ArrayAdapter([])),
);