From a10ca655a2aafe47b2f01dfe5d5036bf11faf83f Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 28 Oct 2024 22:04:01 +0100 Subject: [PATCH] Cover domain filtering in ListShortUrls API test --- module/Rest/test-api/Action/ListShortUrlsTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/module/Rest/test-api/Action/ListShortUrlsTest.php b/module/Rest/test-api/Action/ListShortUrlsTest.php index a17e5161..1eba6db8 100644 --- a/module/Rest/test-api/Action/ListShortUrlsTest.php +++ b/module/Rest/test-api/Action/ListShortUrlsTest.php @@ -8,6 +8,7 @@ use Cake\Chronos\Chronos; use GuzzleHttp\RequestOptions; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Test; +use Shlinkio\Shlink\Core\Domain\Entity\Domain; use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase; use function count; @@ -264,6 +265,15 @@ class ListShortUrlsTest extends ApiTestCase yield [['searchTerm' => 'example.com'], [ self::SHORT_URL_CUSTOM_DOMAIN, ], '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 [[], [ self::SHORT_URL_CUSTOM_SLUG, self::SHORT_URL_META,