Inlcuded tags as part of the ShortUrlMeta

This commit is contained in:
Alejandro Celaya
2021-01-30 19:17:12 +01:00
parent 3f2bd657e1
commit 063ee9c195
14 changed files with 60 additions and 99 deletions

View File

@@ -91,11 +91,11 @@ class GenerateShortUrlCommandTest extends TestCase
{
$shortUrl = ShortUrl::createEmpty();
$urlToShortCode = $this->urlShortener->shorten(
Argument::that(function (array $tags) {
Argument::that(function (ShortUrlMeta $meta) {
$tags = $meta->getTags();
Assert::assertEquals(['foo', 'bar', 'baz', 'boo', 'zar'], $tags);
return $tags;
return true;
}),
Argument::cetera(),
)->willReturn($shortUrl);
$this->commandTester->execute([
@@ -117,7 +117,6 @@ class GenerateShortUrlCommandTest extends TestCase
{
$shortUrl = ShortUrl::createEmpty();
$urlToShortCode = $this->urlShortener->shorten(
Argument::type('array'),
Argument::that(function (ShortUrlMeta $meta) use ($expectedValidateUrl) {
Assert::assertEquals($expectedValidateUrl, $meta->doValidateUrl());
return $meta;