mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Updated UrlShortener to namespace the cache entries
This commit is contained in:
@@ -129,10 +129,10 @@ class UrlShortenerTest extends TestCase
|
||||
$repo->findOneBy(['shortCode' => $shortCode])->willReturn($shortUrl);
|
||||
$this->em->getRepository(ShortUrl::class)->willReturn($repo->reveal());
|
||||
|
||||
$this->assertFalse($this->cache->contains($shortCode));
|
||||
$this->assertFalse($this->cache->contains($shortCode . '_longUrl'));
|
||||
$url = $this->urlShortener->shortCodeToUrl($shortCode);
|
||||
$this->assertEquals($shortUrl->getOriginalUrl(), $url);
|
||||
$this->assertTrue($this->cache->contains($shortCode));
|
||||
$this->assertTrue($this->cache->contains($shortCode . '_longUrl'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -151,7 +151,7 @@ class UrlShortenerTest extends TestCase
|
||||
{
|
||||
$shortCode = '12C1c';
|
||||
$expectedUrl = 'expected_url';
|
||||
$this->cache->save($shortCode, $expectedUrl);
|
||||
$this->cache->save($shortCode . '_longUrl', $expectedUrl);
|
||||
$this->em->getRepository(ShortUrl::class)->willReturn(null)->shouldBeCalledTimes(0);
|
||||
|
||||
$url = $this->urlShortener->shortCodeToUrl($shortCode);
|
||||
|
||||
Reference in New Issue
Block a user