Centralized logic to normalize tag names and removed references to deprecated setTags method in unit tests

This commit is contained in:
Alejandro Celaya
2021-01-31 11:09:00 +01:00
parent 09f25d78b7
commit 1cd6fdeede
2 changed files with 9 additions and 12 deletions

View File

@@ -119,7 +119,7 @@ class UrlShortenerTest extends TestCase
), ShortUrl::withLongUrl($url)];
yield [
ShortUrlMeta::fromRawData(['findIfExists' => true, 'longUrl' => $url, 'tags' => ['foo', 'bar']]),
ShortUrl::withLongUrl($url)->setTags(new ArrayCollection([new Tag('bar'), new Tag('foo')])),
ShortUrl::fromMeta(ShortUrlMeta::fromRawData(['longUrl' => $url, 'tags' => ['foo', 'bar']])),
];
yield [
ShortUrlMeta::fromRawData(['findIfExists' => true, 'maxVisits' => 3, 'longUrl' => $url]),
@@ -157,7 +157,8 @@ class UrlShortenerTest extends TestCase
'validUntil' => Chronos::parse('2017-01-01'),
'maxVisits' => 4,
'longUrl' => $url,
]))->setTags(new ArrayCollection([new Tag('foo'), new Tag('bar'), new Tag('baz')])),
'tags' => ['foo', 'bar', 'baz'],
])),
];
}
}