mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Updated to readonly public props on as many models as possible
This commit is contained in:
@@ -44,9 +44,9 @@ class DomainRedirectsRequestTest extends TestCase
|
||||
$notFound = $request->toNotFoundRedirects($defaults);
|
||||
|
||||
self::assertEquals($expectedAuthority, $request->authority());
|
||||
self::assertEquals($expectedBaseUrlRedirect, $notFound->baseUrlRedirect());
|
||||
self::assertEquals($expectedRegular404Redirect, $notFound->regular404Redirect());
|
||||
self::assertEquals($expectedInvalidShortUrlRedirect, $notFound->invalidShortUrlRedirect());
|
||||
self::assertEquals($expectedBaseUrlRedirect, $notFound->baseUrlRedirect);
|
||||
self::assertEquals($expectedRegular404Redirect, $notFound->regular404Redirect);
|
||||
self::assertEquals($expectedInvalidShortUrlRedirect, $notFound->invalidShortUrlRedirect);
|
||||
}
|
||||
|
||||
public function provideValidData(): iterable
|
||||
|
||||
@@ -36,9 +36,11 @@ class ResolveShortUrlActionTest extends TestCase
|
||||
{
|
||||
$shortCode = 'abc123';
|
||||
$apiKey = ApiKey::create();
|
||||
$this->urlResolver->resolveShortUrl(new ShortUrlIdentifier($shortCode), $apiKey)->willReturn(
|
||||
ShortUrl::withLongUrl('http://domain.com/foo/bar'),
|
||||
)->shouldBeCalledOnce();
|
||||
$this->urlResolver->resolveShortUrl(
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain($shortCode),
|
||||
$apiKey,
|
||||
)->willReturn(ShortUrl::withLongUrl('http://domain.com/foo/bar'))
|
||||
->shouldBeCalledOnce();
|
||||
|
||||
$request = (new ServerRequest())->withAttribute('shortCode', $shortCode)->withAttribute(ApiKey::class, $apiKey);
|
||||
$response = $this->action->handle($request);
|
||||
|
||||
@@ -38,7 +38,7 @@ class ShortUrlVisitsActionTest extends TestCase
|
||||
{
|
||||
$shortCode = 'abc123';
|
||||
$this->visitsHelper->visitsForShortUrl(
|
||||
new ShortUrlIdentifier($shortCode),
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain($shortCode),
|
||||
Argument::type(VisitsParams::class),
|
||||
Argument::type(ApiKey::class),
|
||||
)->willReturn(new Paginator(new ArrayAdapter([])))
|
||||
@@ -52,7 +52,7 @@ class ShortUrlVisitsActionTest extends TestCase
|
||||
public function paramsAreReadFromQuery(): void
|
||||
{
|
||||
$shortCode = 'abc123';
|
||||
$this->visitsHelper->visitsForShortUrl(new ShortUrlIdentifier($shortCode), new VisitsParams(
|
||||
$this->visitsHelper->visitsForShortUrl(ShortUrlIdentifier::fromShortCodeAndDomain($shortCode), new VisitsParams(
|
||||
DateRange::withEndDate(Chronos::parse('2016-01-01 00:00:00')),
|
||||
3,
|
||||
10,
|
||||
|
||||
Reference in New Issue
Block a user