aboutsummaryrefslogtreecommitdiffstats
path: root/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI
diff options
context:
space:
mode:
Diffstat (limited to 'lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI')
-rw-r--r--lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/Email/SimpleCheckTest.php13
-rw-r--r--lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/EmailHarness.php31
-rw-r--r--lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/HostTest.php53
-rw-r--r--lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv4Test.php25
-rw-r--r--lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv6Test.php43
5 files changed, 0 insertions, 165 deletions
diff --git a/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/Email/SimpleCheckTest.php b/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/Email/SimpleCheckTest.php
deleted file mode 100644
index c310347e9..000000000
--- a/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/Email/SimpleCheckTest.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-
-class HTMLPurifier_AttrDef_URI_Email_SimpleCheckTest
- extends HTMLPurifier_AttrDef_URI_EmailHarness
-{
-
- function setUp() {
- $this->def = new HTMLPurifier_AttrDef_URI_Email_SimpleCheck();
- }
-
-}
-
-// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/EmailHarness.php b/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/EmailHarness.php
deleted file mode 100644
index 594e2ce29..000000000
--- a/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/EmailHarness.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-class HTMLPurifier_AttrDef_URI_EmailHarness extends HTMLPurifier_AttrDefHarness
-{
-
- /**
- * Tests common email strings that are obviously pass/fail
- */
- function testCore() {
- $this->assertDef('bob@example.com');
- $this->assertDef(' bob@example.com ', 'bob@example.com');
- $this->assertDef('bob.thebuilder@example.net');
- $this->assertDef('Bob_the_Builder-the-2nd@example.org');
- $this->assertDef('Bob%20the%20Builder@white-space.test');
-
- // extended format, with real name
- //$this->assertDef('Bob%20Builder%20%3Cbobby.bob.bob@it.is.example.com%3E');
- //$this->assertDef('Bob Builder <bobby.bob.bob@it.is.example.com>');
-
- // time to fail
- $this->assertDef('bob', false);
- $this->assertDef('bob@home@work', false);
- $this->assertDef('@example.com', false);
- $this->assertDef('bob@', false);
- $this->assertDef('', false);
-
- }
-
-}
-
-// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/HostTest.php b/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/HostTest.php
deleted file mode 100644
index b5827718b..000000000
--- a/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/HostTest.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-
-// takes a URI formatted host and validates it
-
-
-class HTMLPurifier_AttrDef_URI_HostTest extends HTMLPurifier_AttrDefHarness
-{
-
- function test() {
-
- $this->def = new HTMLPurifier_AttrDef_URI_Host();
-
- $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
-
- // more domain name tests
- $this->assertDef('test.');
- $this->assertDef('sub.test.');
- $this->assertDef('.test', false);
- $this->assertDef('ff');
- $this->assertDef('1f', false);
- $this->assertDef('-f', false);
- $this->assertDef('f1');
- $this->assertDef('f-', false);
- $this->assertDef('sub.ff');
- $this->assertDef('sub.1f', false);
- $this->assertDef('sub.-f', false);
- $this->assertDef('sub.f1');
- $this->assertDef('sub.f-', false);
- $this->assertDef('ff.top');
- $this->assertDef('1f.top');
- $this->assertDef('-f.top', false);
- $this->assertDef('ff.top');
- $this->assertDef('f1.top');
- $this->assertDef('f-.top', false);
-
- $this->assertDef("\xE4\xB8\xAD\xE6\x96\x87.com.cn", false);
-
- }
-
- function testIDNA() {
- if (!$GLOBALS['HTMLPurifierTest']['Net_IDNA2']) {
- return false;
- }
- $this->config->set('Core.EnableIDNA', true);
- $this->assertDef("\xE4\xB8\xAD\xE6\x96\x87.com.cn", "xn--fiq228c.com.cn");
- $this->assertDef("\xe2\x80\x85.com", false); // rejected
- }
-
-}
-
-// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv4Test.php b/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv4Test.php
deleted file mode 100644
index 0a4eb17ba..000000000
--- a/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv4Test.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-// IPv4 test case is spliced from Feyd's IPv6 implementation
-// we ought to disallow non-routable addresses
-
-class HTMLPurifier_AttrDef_URI_IPv4Test extends HTMLPurifier_AttrDefHarness
-{
-
- function test() {
-
- $this->def = new HTMLPurifier_AttrDef_URI_IPv4();
-
- $this->assertDef('127.0.0.1'); // standard IPv4, loopback, non-routable
- $this->assertDef('0.0.0.0'); // standard IPv4, unspecified, non-routable
- $this->assertDef('255.255.255.255'); // standard IPv4
-
- $this->assertDef('300.0.0.0', false); // standard IPv4, out of range
- $this->assertDef('124.15.6.89/60', false); // standard IPv4, prefix not allowed
-
- $this->assertDef('', false); // nothing
-
- }
-}
-
-// vim: et sw=4 sts=4
diff --git a/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv6Test.php b/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv6Test.php
deleted file mode 100644
index 083e818aa..000000000
--- a/lib/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv6Test.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-
-// test case is from Feyd's IPv6 implementation
-// we ought to disallow non-routable addresses
-
-class HTMLPurifier_AttrDef_URI_IPv6Test extends HTMLPurifier_AttrDefHarness
-{
-
- function test() {
-
- $this->def = new HTMLPurifier_AttrDef_URI_IPv6();
-
- $this->assertDef('2001:DB8:0:0:8:800:200C:417A'); // unicast, full
- $this->assertDef('FF01:0:0:0:0:0:0:101'); // multicast, full
- $this->assertDef('0:0:0:0:0:0:0:1'); // loopback, full
- $this->assertDef('0:0:0:0:0:0:0:0'); // unspecified, full
- $this->assertDef('2001:DB8::8:800:200C:417A'); // unicast, compressed
- $this->assertDef('FF01::101'); // multicast, compressed
-
- $this->assertDef('::1'); // loopback, compressed, non-routable
- $this->assertDef('::'); // unspecified, compressed, non-routable
- $this->assertDef('0:0:0:0:0:0:13.1.68.3'); // IPv4-compatible IPv6 address, full, deprecated
- $this->assertDef('0:0:0:0:0:FFFF:129.144.52.38'); // IPv4-mapped IPv6 address, full
- $this->assertDef('::13.1.68.3'); // IPv4-compatible IPv6 address, compressed, deprecated
- $this->assertDef('::FFFF:129.144.52.38'); // IPv4-mapped IPv6 address, compressed
- $this->assertDef('2001:0DB8:0000:CD30:0000:0000:0000:0000/60'); // full, with prefix
- $this->assertDef('2001:0DB8::CD30:0:0:0:0/60'); // compressed, with prefix
- $this->assertDef('2001:0DB8:0:CD30::/60'); // compressed, with prefix #2
- $this->assertDef('::/128'); // compressed, unspecified address type, non-routable
- $this->assertDef('::1/128'); // compressed, loopback address type, non-routable
- $this->assertDef('FF00::/8'); // compressed, multicast address type
- $this->assertDef('FE80::/10'); // compressed, link-local unicast, non-routable
- $this->assertDef('FEC0::/10'); // compressed, site-local unicast, deprecated
-
- $this->assertDef('2001:DB8:0:0:8:800:200C:417A:221', false); // unicast, full
- $this->assertDef('FF01::101::2', false); //multicast, compressed
- $this->assertDef('', false); // nothing
-
- }
-
-}
-
-// vim: et sw=4 sts=4