mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-22 08:56:42 -06:00
Add missing unit test
This commit is contained in:
parent
f49d98f2ea
commit
bab6a3951e
@ -116,6 +116,7 @@ class RedirectRuleHandlerTest extends TestCase
|
|||||||
'Language to match?' => 'en-US',
|
'Language to match?' => 'en-US',
|
||||||
'Query param name?' => 'foo',
|
'Query param name?' => 'foo',
|
||||||
'Query param value?' => 'bar',
|
'Query param value?' => 'bar',
|
||||||
|
'IP address, CIDR block or wildcard-pattern (1.2.*.*)' => '1.2.3.4',
|
||||||
default => '',
|
default => '',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -163,6 +164,7 @@ class RedirectRuleHandlerTest extends TestCase
|
|||||||
[RedirectCondition::forQueryParam('foo', 'bar'), RedirectCondition::forQueryParam('foo', 'bar')],
|
[RedirectCondition::forQueryParam('foo', 'bar'), RedirectCondition::forQueryParam('foo', 'bar')],
|
||||||
true,
|
true,
|
||||||
];
|
];
|
||||||
|
yield 'IP address' => [RedirectConditionType::IP_ADDRESS, [RedirectCondition::forIpAddress('1.2.3.4')]];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Test]
|
#[Test]
|
||||||
|
@ -26,7 +26,7 @@ final class IpAddressUtils
|
|||||||
* Matching will happen as follows:
|
* Matching will happen as follows:
|
||||||
* * Static IP address -> strict equality with provided IP address.
|
* * Static IP address -> strict equality with provided IP address.
|
||||||
* * CIDR block -> provided IP address is part of that block.
|
* * CIDR block -> provided IP address is part of that block.
|
||||||
* * Wildcard -> static parts match the corresponding ones in provided IP address.
|
* * Wildcard pattern -> static parts match the corresponding ones in provided IP address.
|
||||||
*
|
*
|
||||||
* @param string[] $groups
|
* @param string[] $groups
|
||||||
* @throws InvalidIpFormatException
|
* @throws InvalidIpFormatException
|
||||||
|
Loading…
Reference in New Issue
Block a user