mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 01:03:13 +08:00
Updated to readonly public props on as many models as possible
This commit is contained in:
@@ -55,7 +55,7 @@ class DeleteShortUrlServiceTest extends TestCase
|
||||
$this->shortCode,
|
||||
));
|
||||
|
||||
$service->deleteByShortCode(new ShortUrlIdentifier($this->shortCode));
|
||||
$service->deleteByShortCode(ShortUrlIdentifier::fromShortCodeAndDomain($this->shortCode));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
@@ -66,7 +66,7 @@ class DeleteShortUrlServiceTest extends TestCase
|
||||
$remove = $this->em->remove(Argument::type(ShortUrl::class))->willReturn(null);
|
||||
$flush = $this->em->flush()->willReturn(null);
|
||||
|
||||
$service->deleteByShortCode(new ShortUrlIdentifier($this->shortCode), true);
|
||||
$service->deleteByShortCode(ShortUrlIdentifier::fromShortCodeAndDomain($this->shortCode), true);
|
||||
|
||||
$remove->shouldHaveBeenCalledOnce();
|
||||
$flush->shouldHaveBeenCalledOnce();
|
||||
@@ -80,7 +80,7 @@ class DeleteShortUrlServiceTest extends TestCase
|
||||
$remove = $this->em->remove(Argument::type(ShortUrl::class))->willReturn(null);
|
||||
$flush = $this->em->flush()->willReturn(null);
|
||||
|
||||
$service->deleteByShortCode(new ShortUrlIdentifier($this->shortCode));
|
||||
$service->deleteByShortCode(ShortUrlIdentifier::fromShortCodeAndDomain($this->shortCode));
|
||||
|
||||
$remove->shouldHaveBeenCalledOnce();
|
||||
$flush->shouldHaveBeenCalledOnce();
|
||||
@@ -94,7 +94,7 @@ class DeleteShortUrlServiceTest extends TestCase
|
||||
$remove = $this->em->remove(Argument::type(ShortUrl::class))->willReturn(null);
|
||||
$flush = $this->em->flush()->willReturn(null);
|
||||
|
||||
$service->deleteByShortCode(new ShortUrlIdentifier($this->shortCode));
|
||||
$service->deleteByShortCode(ShortUrlIdentifier::fromShortCodeAndDomain($this->shortCode));
|
||||
|
||||
$remove->shouldHaveBeenCalledOnce();
|
||||
$flush->shouldHaveBeenCalledOnce();
|
||||
|
||||
@@ -91,7 +91,7 @@ class ShortUrlResolverTest extends TestCase
|
||||
)->willReturn($shortUrl);
|
||||
$getRepo = $this->em->getRepository(ShortUrl::class)->willReturn($repo->reveal());
|
||||
|
||||
$result = $this->urlResolver->resolveEnabledShortUrl(new ShortUrlIdentifier($shortCode));
|
||||
$result = $this->urlResolver->resolveEnabledShortUrl(ShortUrlIdentifier::fromShortCodeAndDomain($shortCode));
|
||||
|
||||
self::assertSame($shortUrl, $result);
|
||||
$findOneByShortCode->shouldHaveBeenCalledOnce();
|
||||
@@ -116,7 +116,7 @@ class ShortUrlResolverTest extends TestCase
|
||||
$findOneByShortCode->shouldBeCalledOnce();
|
||||
$getRepo->shouldBeCalledOnce();
|
||||
|
||||
$this->urlResolver->resolveEnabledShortUrl(new ShortUrlIdentifier($shortCode));
|
||||
$this->urlResolver->resolveEnabledShortUrl(ShortUrlIdentifier::fromShortCodeAndDomain($shortCode));
|
||||
}
|
||||
|
||||
public function provideDisabledShortUrls(): iterable
|
||||
|
||||
@@ -88,7 +88,7 @@ class ShortUrlServiceTest extends TestCase
|
||||
$shortUrl = ShortUrl::withLongUrl($originalLongUrl);
|
||||
|
||||
$findShortUrl = $this->urlResolver->resolveShortUrl(
|
||||
new ShortUrlIdentifier('abc123'),
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain('abc123'),
|
||||
$apiKey,
|
||||
)->willReturn($shortUrl);
|
||||
$flush = $this->em->flush()->willReturn(null);
|
||||
@@ -97,7 +97,11 @@ class ShortUrlServiceTest extends TestCase
|
||||
$shortUrlEdit,
|
||||
);
|
||||
|
||||
$result = $this->service->updateShortUrl(new ShortUrlIdentifier('abc123'), $shortUrlEdit, $apiKey);
|
||||
$result = $this->service->updateShortUrl(
|
||||
ShortUrlIdentifier::fromShortCodeAndDomain('abc123'),
|
||||
$shortUrlEdit,
|
||||
$apiKey,
|
||||
);
|
||||
|
||||
self::assertSame($shortUrl, $result);
|
||||
self::assertEquals($shortUrlEdit->validSince(), $shortUrl->getValidSince());
|
||||
|
||||
Reference in New Issue
Block a user