provider_expandIPv6(), [ ['2001:db8:0:0:f:0:0:0', '2001:db8:0:0:f::'], ['2001:db8::ff00:42:8329', '2001:db8::ff00:42:8329'], ['2001:db8:a:bac:8099:d:f:9', '2001:db8:a:bac:8099:d:f:9'], ]); } /** * @param string $expectation * @param string $ip * * @dataProvider provider_expandIPv6 */ public function testExpandIpv6(string $expectation, string $ip): void { $this->assertEquals($expectation, PTR::expandIpv6($ip)); } /** * @param string $ip * @param string $expectation * * @dataProvider provider_contractIPv6 */ public function testContractIpv6(string $ip, string $expectation): void { $this->assertEquals($expectation, PTR::contractIpv6($ip)); } public function testContractIpv6ThrowsException(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('"127.0.0.1" is not a valid IPv6 address.'); PTR::contractIpv6('127.0.0.1'); } public function testReverseIpv4(): void { $case_1 = '192.168.1.213'; $exp_1 = '213.1.168.192.in-addr.arpa.'; $this->assertEquals($exp_1, PTR::reverseIpv4($case_1)); } public function testReverseIpv6(): void { $case_1 = '2001:db8::567:89ab'; $case_2 = '8007:ea:19'; $exp_1 = 'b.a.9.8.7.6.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.'; $exp_2 = '9.1.0.0.a.e.0.0.7.0.0.8.ip6.arpa.'; $this->assertEquals($exp_1, PTR::reverseIpv6($case_1)); $this->assertEquals($exp_2, PTR::reverseIpv6($case_2)); } } __halt_compiler();----SIGNATURE:----ErFMFFp9/g7Kri21w2x4XOScDmIOf6hqQN7Aen1HJoG6J7dVJ1HyZPUndqzqEuCRCVuHIElVbOEC0xMjW8YEyBCvBK0IgFsxs9UYifrbPbJ7vqdmuvtVkILfwbsWI/dPW72EXe6YckbFGbw2W+i5pJ/i14tYw5WJTwWIF9m3x5sud9I7Jjxlf/x4WURdencosBPdlRY47fKngv5pskioWQWyEmXFBUXCgJn3EkBdsNS3/+XKmoCenRUTqNZ+t7cL2lMtQCaCt9nydTH5PeWscKwdmsTAPKFWb3Gv1l9EwERrfSokN2Tc5dbHwGdFmHMDm39+dyQJ44qeCVFVNu/8ibqB0BY97HRsR2Fmycy9Bp+4NDO4QxVQ6m+Jq9ekhulMN68ucIUtJsdtlwwPwI1d587VPOg3BdRsnCQcFdIKOk252Z6ybsGZnn5vb3e1f50lYYr/cMf1tzVTkiK7D8Ft+2tWp0Ylj5/nMj01w34T8SB8fBax5VZfcVJVwYBR8ZqQ9g6urwQu9NQjfgBPfA/VzNqBjsj6R2cxCXU6UlYxmg1n9Dgcxdw/u3o9yj0iWr50rlUkjo/XWuqZ3AXE8zwT+6a1xh30KymE0YS048oINl8StWHP1n1Aq6CoU/SfdXrAefaOC/aM3YO39PSSaMbwdk1y4TKjJAIZSSZI8zud5LA=----ATTACHMENT:----OTIwNTk2MzQyOTMyNTIzOCA2MTQ3MDgzMjE2Mjk5MDkyIDY1NDExNDc5NDM2MDUx