2 declare(strict_types = 1);
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
35 'empty address' => [
'', 1,
''],
36 'IPv4 address with mask 0' => [
'192.158.130.10', 0,
'192.158.130.10'],
37 'IPv4 address with mask 1' => [
'192.158.130.10', 1,
'192.158.130.0'],
38 'IPv4 address with mask 2' => [
'192.158.130.10', 2,
'192.158.0.0'],
39 'IPv4 address with fallback' => [
'192.158.130.10',
null,
'192.158.130.0'],
40 'IPv6 address with mask 0' => [
'0064:ff9b:0000:0000:0000:0000:18.52.86.120', 0,
'0064:ff9b:0000:0000:0000:0000:18.52.86.120'],
41 'IPv6 address with mask 1' => [
'2002:6dcd:8c74:6501:fb2:61c:ac98:6bea', 1,
'2002:6dcd:8c74:6501::'],
42 'IPv6 address with mask 2' => [
'2002:6dcd:8c74:6501:fb2:61c:ac98:6bea', 2,
'2002:6dcd:8c74::'],
43 'IPv6 address with fallback' => [
'2002:6dcd:8c74:6501:fb2:61c:ac98:6bea',
null,
'2002:6dcd:8c74:6501::'],
44 'IPv4-Embedded IPv6 Address' => [
'::ffff:18.52.86.120', 1,
'::'],
45 'anonymized IPv4 address' => [
'192.158.0.0', 1,
'192.158.0.0'],
46 'invalid IPv4 address given' => [
'127.0.01', 1,
''],
47 'invalid IPv6 address given' => [
'ffff18.52.86.120', 1,
''],
61 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'ipAnonymization'] = 1;
70 $this->expectException(\UnexpectedValueException::class);
71 $this->expectExceptionCode(1519739203);