Enforce a schema to be provided when short URLs are created

This commit is contained in:
Alejandro Celaya
2023-03-25 09:52:47 +01:00
parent 11f94b8306
commit b6e1c65c4c
26 changed files with 135 additions and 107 deletions

View File

@@ -49,7 +49,7 @@ class ListShortUrlsCommandTest extends TestCase
// The paginator will return more than one page
$data = [];
for ($i = 0; $i < 50; $i++) {
$data[] = ShortUrl::withLongUrl('url_' . $i);
$data[] = ShortUrl::withLongUrl('https://url_' . $i);
}
$this->shortUrlService->expects($this->exactly(3))->method('listShortUrls')->withAnyParameters()
@@ -71,7 +71,7 @@ class ListShortUrlsCommandTest extends TestCase
// The paginator will return more than one page
$data = [];
for ($i = 0; $i < 30; $i++) {
$data[] = ShortUrl::withLongUrl('url_' . $i);
$data[] = ShortUrl::withLongUrl('https://url_' . $i);
}
$this->shortUrlService->expects($this->once())->method('listShortUrls')->with(
@@ -114,7 +114,7 @@ class ListShortUrlsCommandTest extends TestCase
ShortUrlsParams::emptyInstance(),
)->willReturn(new Paginator(new ArrayAdapter([
ShortUrl::create(ShortUrlCreation::fromRawData([
'longUrl' => 'foo.com',
'longUrl' => 'https://foo.com',
'tags' => ['foo', 'bar', 'baz'],
'apiKey' => $apiKey,
])),