2006-08-17 01:05:35 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once 'HTMLPurifier/AttrDefHarness.php';
|
2007-02-14 20:38:51 +00:00
|
|
|
require_once 'HTMLPurifier/AttrDef/URI/Host.php';
|
2006-08-17 01:05:35 +00:00
|
|
|
|
|
|
|
// takes a URI formatted host and validates it
|
|
|
|
|
|
|
|
|
2007-02-14 20:38:51 +00:00
|
|
|
class HTMLPurifier_AttrDef_URI_HostTest extends HTMLPurifier_AttrDefHarness
|
2006-08-17 01:05:35 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
|
2007-02-14 20:38:51 +00:00
|
|
|
$this->def = new HTMLPurifier_AttrDef_URI_Host();
|
2006-08-17 01:05:35 +00:00
|
|
|
|
|
|
|
$this->assertDef('[2001:DB8:0:0:8:800:200C:417A]'); // IPv6
|
|
|
|
$this->assertDef('124.15.6.89'); // IPv4
|
|
|
|
$this->assertDef('www.google.com'); // reg-name
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|