Added more API tests covering the new tagsMode param on short URLs list

This commit is contained in:
Alejandro Celaya 2022-01-04 14:34:31 +01:00
parent 0e25af790d
commit 0447aa07fa

View File

@ -189,6 +189,25 @@ class ListShortUrlsTest extends ApiTestCase
yield [['tags' => ['bar']], [
self::SHORT_URL_META,
], 'valid_api_key'];
yield [['tags' => ['foo', 'bar']], [
self::SHORT_URL_SHLINK_WITH_TITLE,
self::SHORT_URL_META,
self::SHORT_URL_CUSTOM_DOMAIN,
], 'valid_api_key'];
yield [['tags' => ['foo', 'bar'], 'tagsMode' => 'any'], [
self::SHORT_URL_SHLINK_WITH_TITLE,
self::SHORT_URL_META,
self::SHORT_URL_CUSTOM_DOMAIN,
], 'valid_api_key'];
yield [['tags' => ['foo', 'bar'], 'tagsMode' => 'all'], [
self::SHORT_URL_META,
], 'valid_api_key'];
yield [['tags' => ['foo', 'bar', 'baz']], [
self::SHORT_URL_SHLINK_WITH_TITLE,
self::SHORT_URL_META,
self::SHORT_URL_CUSTOM_DOMAIN,
], 'valid_api_key'];
yield [['tags' => ['foo', 'bar', 'baz'], 'tagsMode' => 'all'], [], 'valid_api_key'];
yield [['tags' => ['foo'], 'endDate' => Chronos::parse('2018-12-01')->toAtomString()], [
self::SHORT_URL_SHLINK_WITH_TITLE,
], 'valid_api_key'];