PSR-2 reformatting PHPDoc corrections
[htmlpurifier.git] / tests / HTMLPurifier / AttrDef / URI / IPv6Test.php
blobf46785c1adbf861b4b0a3568504af23f4cd9192f
1 <?php
3 // test case is from Feyd's IPv6 implementation
4 // we ought to disallow non-routable addresses
6 class HTMLPurifier_AttrDef_URI_IPv6Test extends HTMLPurifier_AttrDefHarness
9 public function test()
11 $this->def = new HTMLPurifier_AttrDef_URI_IPv6();
13 $this->assertDef('2001:DB8:0:0:8:800:200C:417A'); // unicast, full
14 $this->assertDef('FF01:0:0:0:0:0:0:101'); // multicast, full
15 $this->assertDef('0:0:0:0:0:0:0:1'); // loopback, full
16 $this->assertDef('0:0:0:0:0:0:0:0'); // unspecified, full
17 $this->assertDef('2001:DB8::8:800:200C:417A'); // unicast, compressed
18 $this->assertDef('FF01::101'); // multicast, compressed
20 $this->assertDef('::1'); // loopback, compressed, non-routable
21 $this->assertDef('::'); // unspecified, compressed, non-routable
22 $this->assertDef('0:0:0:0:0:0:13.1.68.3'); // IPv4-compatible IPv6 address, full, deprecated
23 $this->assertDef('0:0:0:0:0:FFFF:129.144.52.38'); // IPv4-mapped IPv6 address, full
24 $this->assertDef('::13.1.68.3'); // IPv4-compatible IPv6 address, compressed, deprecated
25 $this->assertDef('::FFFF:129.144.52.38'); // IPv4-mapped IPv6 address, compressed
26 $this->assertDef('2001:0DB8:0000:CD30:0000:0000:0000:0000/60'); // full, with prefix
27 $this->assertDef('2001:0DB8::CD30:0:0:0:0/60'); // compressed, with prefix
28 $this->assertDef('2001:0DB8:0:CD30::/60'); // compressed, with prefix #2
29 $this->assertDef('::/128'); // compressed, unspecified address type, non-routable
30 $this->assertDef('::1/128'); // compressed, loopback address type, non-routable
31 $this->assertDef('FF00::/8'); // compressed, multicast address type
32 $this->assertDef('FE80::/10'); // compressed, link-local unicast, non-routable
33 $this->assertDef('FEC0::/10'); // compressed, site-local unicast, deprecated
35 $this->assertDef('2001:DB8:0:0:8:800:200C:417A:221', false); // unicast, full
36 $this->assertDef('FF01::101::2', false); //multicast, compressed
37 $this->assertDef('', false); // nothing
43 // vim: et sw=4 sts=4