mirror of
https://github.com/shlinkio/shlink.git
synced 2025-01-22 14:33:16 -06:00
Added API test which checks short URLs with a domain are parsed as such
This commit is contained in:
parent
d0bb86ca8f
commit
8da6b336f5
@ -63,13 +63,31 @@ class ListShortUrlsTest extends ApiTestCase
|
|||||||
],
|
],
|
||||||
'originalUrl' => 'https://shlink.io',
|
'originalUrl' => 'https://shlink.io',
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'shortCode' => 'ghi789',
|
||||||
|
'shortUrl' => 'http://example.com/ghi789',
|
||||||
|
'longUrl' =>
|
||||||
|
'https://blog.alejandrocelaya.com/2019/04/27'
|
||||||
|
. '/considerations-to-properly-use-open-source-software-projects/',
|
||||||
|
'dateCreated' => '2019-01-01T00:00:00+00:00',
|
||||||
|
'visitsCount' => 0,
|
||||||
|
'tags' => [],
|
||||||
|
'meta' => [
|
||||||
|
'validSince' => null,
|
||||||
|
'validUntil' => null,
|
||||||
|
'maxVisits' => null,
|
||||||
|
],
|
||||||
|
'originalUrl' =>
|
||||||
|
'https://blog.alejandrocelaya.com/2019/04/27'
|
||||||
|
. '/considerations-to-properly-use-open-source-software-projects/',
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'pagination' => [
|
'pagination' => [
|
||||||
'currentPage' => 1,
|
'currentPage' => 1,
|
||||||
'pagesCount' => 1,
|
'pagesCount' => 1,
|
||||||
'itemsPerPage' => 10,
|
'itemsPerPage' => 10,
|
||||||
'itemsInCurrentPage' => 3,
|
'itemsInCurrentPage' => 4,
|
||||||
'totalItems' => 3,
|
'totalItems' => 4,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
], $respPayload);
|
], $respPayload);
|
||||||
|
@ -34,6 +34,12 @@ class ShortUrlsFixture extends AbstractFixture
|
|||||||
));
|
));
|
||||||
$manager->persist($customShortUrl);
|
$manager->persist($customShortUrl);
|
||||||
|
|
||||||
|
$withDomainShortUrl = $this->setShortUrlDate(new ShortUrl(
|
||||||
|
'https://blog.alejandrocelaya.com/2019/04/27/considerations-to-properly-use-open-source-software-projects/',
|
||||||
|
ShortUrlMeta::createFromRawData(['domain' => 'example.com'])
|
||||||
|
))->setShortCode('ghi789');
|
||||||
|
$manager->persist($withDomainShortUrl);
|
||||||
|
|
||||||
$manager->flush();
|
$manager->flush();
|
||||||
|
|
||||||
$this->addReference('abc123_short_url', $abcShortUrl);
|
$this->addReference('abc123_short_url', $abcShortUrl);
|
||||||
|
Loading…
Reference in New Issue
Block a user