mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 09:43:13 +08:00
Make RedirectCondition->matchValue nullable
This commit is contained in:
@@ -17,11 +17,6 @@ class ListRedirectRulesTest extends ApiTestCase
|
||||
'matchKey' => null,
|
||||
'matchValue' => 'en',
|
||||
];
|
||||
private const array QUERY_FOO_BAR_CONDITION = [
|
||||
'type' => 'query-param',
|
||||
'matchKey' => 'foo',
|
||||
'matchValue' => 'bar',
|
||||
];
|
||||
|
||||
#[Test]
|
||||
public function errorIsReturnedWhenInvalidUrlIsFetched(): void
|
||||
@@ -45,7 +40,11 @@ class ListRedirectRulesTest extends ApiTestCase
|
||||
'priority' => 1,
|
||||
'conditions' => [
|
||||
self::LANGUAGE_EN_CONDITION,
|
||||
self::QUERY_FOO_BAR_CONDITION,
|
||||
[
|
||||
'type' => 'any-value-query-param',
|
||||
'matchKey' => 'foo',
|
||||
'matchValue' => null,
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
@@ -57,7 +56,11 @@ class ListRedirectRulesTest extends ApiTestCase
|
||||
'matchKey' => 'hello',
|
||||
'matchValue' => 'world',
|
||||
],
|
||||
self::QUERY_FOO_BAR_CONDITION,
|
||||
[
|
||||
'type' => 'query-param',
|
||||
'matchKey' => 'foo',
|
||||
'matchValue' => 'bar',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
|
||||
@@ -18,11 +18,6 @@ class SetRedirectRulesTest extends ApiTestCase
|
||||
'matchKey' => null,
|
||||
'matchValue' => 'en',
|
||||
];
|
||||
private const array QUERY_FOO_BAR_CONDITION = [
|
||||
'type' => 'query-param',
|
||||
'matchKey' => 'foo',
|
||||
'matchValue' => 'bar',
|
||||
];
|
||||
|
||||
#[Test]
|
||||
public function errorIsReturnedWhenInvalidUrlIsProvided(): void
|
||||
@@ -132,7 +127,11 @@ class SetRedirectRulesTest extends ApiTestCase
|
||||
'priority' => 1,
|
||||
'conditions' => [
|
||||
self::LANGUAGE_EN_CONDITION,
|
||||
self::QUERY_FOO_BAR_CONDITION,
|
||||
[
|
||||
'type' => 'any-value-query-param',
|
||||
'matchKey' => 'foo',
|
||||
'matchValue' => null,
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
@@ -144,7 +143,11 @@ class SetRedirectRulesTest extends ApiTestCase
|
||||
'matchKey' => 'hello',
|
||||
'matchValue' => 'world',
|
||||
],
|
||||
self::QUERY_FOO_BAR_CONDITION,
|
||||
[
|
||||
'type' => 'query-param',
|
||||
'matchKey' => 'foo',
|
||||
'matchValue' => 'bar',
|
||||
],
|
||||
],
|
||||
],
|
||||
]])]
|
||||
|
||||
@@ -41,7 +41,7 @@ class ShortUrlRedirectRulesFixture extends AbstractFixture implements DependentF
|
||||
priority: 1,
|
||||
longUrl: 'https://example.com/english-and-foo-query',
|
||||
conditions: new ArrayCollection(
|
||||
[RedirectCondition::forLanguage('en'), RedirectCondition::forQueryParam('foo', 'bar')],
|
||||
[RedirectCondition::forLanguage('en'), RedirectCondition::forAnyValueQueryParam('foo')],
|
||||
),
|
||||
);
|
||||
$manager->persist($englishAndFooQueryRule);
|
||||
|
||||
Reference in New Issue
Block a user