Improved public API in ShortUrl entity, reducing anemic model

This commit is contained in:
Alejandro Celaya
2018-10-28 16:00:54 +01:00
parent 877b098b09
commit 8e1e8ba7de
26 changed files with 96 additions and 148 deletions

View File

@@ -43,7 +43,7 @@ class ResolveUrlCommandTest extends TestCase
{
$shortCode = 'abc123';
$expectedUrl = 'http://domain.com/foo/bar';
$shortUrl = (new ShortUrl())->setLongUrl($expectedUrl);
$shortUrl = new ShortUrl($expectedUrl);
$this->urlShortener->shortCodeToUrl($shortCode)->willReturn($shortUrl)
->shouldBeCalledTimes(1);