Cover domain filtering in ListShortUrls API test

This commit is contained in:
Alejandro Celaya 2024-10-28 22:04:01 +01:00
parent bb270396b6
commit a10ca655a2

View File

@ -8,6 +8,7 @@ use Cake\Chronos\Chronos;
use GuzzleHttp\RequestOptions; use GuzzleHttp\RequestOptions;
use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\Attributes\Test;
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase; use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase;
use function count; use function count;
@ -264,6 +265,15 @@ class ListShortUrlsTest extends ApiTestCase
yield [['searchTerm' => 'example.com'], [ yield [['searchTerm' => 'example.com'], [
self::SHORT_URL_CUSTOM_DOMAIN, self::SHORT_URL_CUSTOM_DOMAIN,
], 'valid_api_key']; ], 'valid_api_key'];
yield [['domain' => 'example.com'], [
self::SHORT_URL_CUSTOM_DOMAIN,
], 'valid_api_key'];
yield [['domain' => Domain::DEFAULT_AUTHORITY], [
self::SHORT_URL_CUSTOM_SLUG,
self::SHORT_URL_META,
self::SHORT_URL_SHLINK_WITH_TITLE,
self::SHORT_URL_DOCS,
], 'valid_api_key'];
yield [[], [ yield [[], [
self::SHORT_URL_CUSTOM_SLUG, self::SHORT_URL_CUSTOM_SLUG,
self::SHORT_URL_META, self::SHORT_URL_META,