From 831db14c790358246b663ac16430bf2e92a249e0 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Mon, 21 May 2007 00:24:32 +0000 Subject: [PATCH] [1.7.0] Remove HTMLModule tests. They were a bad idea. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1083 48356398-32a2-884e-a903-53898d9a118a --- tests/HTMLPurifier/HTMLModule/BdoTest.php | 42 ------------- tests/HTMLPurifier/HTMLModule/EditTest.php | 60 ------------------- .../HTMLPurifier/HTMLModule/HypertextTest.php | 55 ----------------- tests/HTMLPurifier/HTMLModule/ImageTest.php | 53 ---------------- tests/HTMLPurifier/HTMLModule/LegacyTest.php | 34 ----------- tests/HTMLPurifier/HTMLModuleHarness.php | 21 ------- tests/test_files.php | 5 -- 7 files changed, 270 deletions(-) delete mode 100644 tests/HTMLPurifier/HTMLModule/BdoTest.php delete mode 100644 tests/HTMLPurifier/HTMLModule/EditTest.php delete mode 100644 tests/HTMLPurifier/HTMLModule/HypertextTest.php delete mode 100644 tests/HTMLPurifier/HTMLModule/ImageTest.php delete mode 100644 tests/HTMLPurifier/HTMLModule/LegacyTest.php diff --git a/tests/HTMLPurifier/HTMLModule/BdoTest.php b/tests/HTMLPurifier/HTMLModule/BdoTest.php deleted file mode 100644 index 51a74b3e..00000000 --- a/tests/HTMLPurifier/HTMLModule/BdoTest.php +++ /dev/null @@ -1,42 +0,0 @@ -setupScaffold('Bdo'); - - // max - $this->assertResult( - ' - - #PCDATA Inline - - ' - ); - - // min - $this->assertResult( - '', '' - ); - - // children - $this->assertResult( - 'Text
', - 'Text' - ); - - // global attr - $this->assertResult( - '
', - '
' - ); - - } - -} - -?> \ No newline at end of file diff --git a/tests/HTMLPurifier/HTMLModule/EditTest.php b/tests/HTMLPurifier/HTMLModule/EditTest.php deleted file mode 100644 index e6fe8c44..00000000 --- a/tests/HTMLPurifier/HTMLModule/EditTest.php +++ /dev/null @@ -1,60 +0,0 @@ -setupScaffold('Edit'); - - // max - $this->assertResult( - ' - - #PCDATA - - - #PCDATA - - -
- - #PCDATA
-
- - #PCDATA
-
-
' - ); - - // inline removal - $this->assertResult( - ' -
-
-
', - ' - - - ' - ); - - // unsupported attributes - $this->assertResult( - ' - ', - ' - ' - ); - - } - -} - -?> \ No newline at end of file diff --git a/tests/HTMLPurifier/HTMLModule/HypertextTest.php b/tests/HTMLPurifier/HTMLModule/HypertextTest.php deleted file mode 100644 index 11d316cc..00000000 --- a/tests/HTMLPurifier/HTMLModule/HypertextTest.php +++ /dev/null @@ -1,55 +0,0 @@ -setupScaffold('Hypertext', array( - 'Attr.AllowedRel' => 'nofollow', - 'Attr.AllowedRev' => 'index' - )); - - // max - $this->assertResult( - ' - - #PCDATA Inline - - ', true - ); - - // invalid children - $this->assertResult( - 'Text
', - 'Text' - ); - - // unsupported attributes - $this->assertResult( - '', - '' - ); - - } - -} - -?> \ No newline at end of file diff --git a/tests/HTMLPurifier/HTMLModule/ImageTest.php b/tests/HTMLPurifier/HTMLModule/ImageTest.php deleted file mode 100644 index 11178ff5..00000000 --- a/tests/HTMLPurifier/HTMLModule/ImageTest.php +++ /dev/null @@ -1,53 +0,0 @@ -setupScaffold('Image'); - - // max - $this->assertResult( - ' - Example image - ' - ); - - // required attributes - $this->assertResult( - '', - 'foo.png' - ); - - // empty - $this->assertResult( - 'foo', - 'foo' - ); - - // unsupported attributes - $this->assertResult( - 'Example', - 'Example' - ); - - } - -} - -?> \ No newline at end of file diff --git a/tests/HTMLPurifier/HTMLModule/LegacyTest.php b/tests/HTMLPurifier/HTMLModule/LegacyTest.php deleted file mode 100644 index 5f8ca364..00000000 --- a/tests/HTMLPurifier/HTMLModule/LegacyTest.php +++ /dev/null @@ -1,34 +0,0 @@ -setupScaffold('Legacy'); - - // max - $this->assertResult( - ' - Text - Text - Text - ' - ); - - // redefinitions - /*$this->assertResult( - '
    -
  1. Foo
  2. -
-
Text

-
Text
' - );*/ - - } - -} - -?> \ No newline at end of file diff --git a/tests/HTMLPurifier/HTMLModuleHarness.php b/tests/HTMLPurifier/HTMLModuleHarness.php index 70dc8ed5..1f60f435 100644 --- a/tests/HTMLPurifier/HTMLModuleHarness.php +++ b/tests/HTMLPurifier/HTMLModuleHarness.php @@ -9,27 +9,6 @@ class HTMLPurifier_HTMLModuleHarness extends HTMLPurifier_StrategyHarness parent::setup(); $this->obj = new HTMLPurifier_Strategy_Core(); } - - function setupScaffold($module, $config = array()) { - - $this->config = HTMLPurifier_Config::create($config); - $this->config->set('HTML', 'AllowedModules', $module); - $def =& $this->config->getHTMLDefinition(true); - $def->manager->addModule(new HTMLPurifier_HTMLModuleHarness_Scaffold()); - - } -} - -/** - * Special module that defines scaffolding for easy unit testing - */ -class HTMLPurifier_HTMLModuleHarness_Scaffold extends HTMLPurifier_HTMLModule -{ - var $name = 'Scaffold'; - var $attr_collections = array( - 'Common' => array('ac:common' => 'Text'), - 'Core' => array('ac:core' => 'Text') - ); } ?> \ No newline at end of file diff --git a/tests/test_files.php b/tests/test_files.php index 1112f231..21c7b943 100644 --- a/tests/test_files.php +++ b/tests/test_files.php @@ -65,11 +65,6 @@ $test_files[] = 'EntityParserTest.php'; $test_files[] = 'GeneratorTest.php'; $test_files[] = 'HTMLModuleManagerTest.php'; $test_files[] = 'HTMLModuleTest.php'; -$test_files[] = 'HTMLModule/BdoTest.php'; -$test_files[] = 'HTMLModule/EditTest.php'; -$test_files[] = 'HTMLModule/HypertextTest.php'; -$test_files[] = 'HTMLModule/ImageTest.php'; -$test_files[] = 'HTMLModule/LegacyTest.php'; $test_files[] = 'HTMLModule/ScriptingTest.php'; $test_files[] = 'HTMLModule/TidyTest.php'; $test_files[] = 'IDAccumulatorTest.php';