From 119c70fc051893484e35b15b423acb165e476b28 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Wed, 9 Apr 2008 01:56:19 +0000 Subject: [PATCH] Remove some vestigial SimpleTest code, fix some tests, also reload the includes. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1654 48356398-32a2-884e-a903-53898d9a118a --- library/HTMLPurifier.includes.php | 13 ------------- library/HTMLPurifier.safe-includes.php | 13 ------------- tests/HTMLPurifier/ConfigSchemaTest.php | 4 ---- tests/HTMLPurifier/ConfigTest.php | 10 +++------- tests/HTMLPurifier/Harness.php | 1 + tests/common.php | 1 - tests/index.php | 1 - tests/tally_errors.func.php | 17 ----------------- 8 files changed, 4 insertions(+), 56 deletions(-) delete mode 100644 tests/tally_errors.func.php diff --git a/library/HTMLPurifier.includes.php b/library/HTMLPurifier.includes.php index ae75fc3b..0679711f 100644 --- a/library/HTMLPurifier.includes.php +++ b/library/HTMLPurifier.includes.php @@ -55,7 +55,6 @@ require 'HTMLPurifier/Language.php'; require 'HTMLPurifier/LanguageFactory.php'; require 'HTMLPurifier/Lexer.php'; require 'HTMLPurifier/PercentEncoder.php'; -require 'HTMLPurifier/Printer.php'; require 'HTMLPurifier/Strategy.php'; require 'HTMLPurifier/StringHash.php'; require 'HTMLPurifier/StringHashParser.php'; @@ -127,15 +126,6 @@ require 'HTMLPurifier/ChildDef/Table.php'; require 'HTMLPurifier/ConfigDef/Directive.php'; require 'HTMLPurifier/ConfigDef/DirectiveAlias.php'; require 'HTMLPurifier/ConfigDef/Namespace.php'; -require 'HTMLPurifier/ConfigSchema/Exception.php'; -require 'HTMLPurifier/ConfigSchema/Interchange.php'; -require 'HTMLPurifier/ConfigSchema/InterchangeBuilder.php'; -require 'HTMLPurifier/ConfigSchema/Validator.php'; -require 'HTMLPurifier/ConfigSchema/ValidatorAtom.php'; -require 'HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php'; -require 'HTMLPurifier/ConfigSchema/Interchange/Directive.php'; -require 'HTMLPurifier/ConfigSchema/Interchange/Id.php'; -require 'HTMLPurifier/ConfigSchema/Interchange/Namespace.php'; require 'HTMLPurifier/DefinitionCache/Decorator.php'; require 'HTMLPurifier/DefinitionCache/Null.php'; require 'HTMLPurifier/DefinitionCache/Serializer.php'; @@ -170,9 +160,6 @@ require 'HTMLPurifier/Injector/Linkify.php'; require 'HTMLPurifier/Injector/PurifierLinkify.php'; require 'HTMLPurifier/Lexer/DOMLex.php'; require 'HTMLPurifier/Lexer/DirectLex.php'; -require 'HTMLPurifier/Printer/CSSDefinition.php'; -require 'HTMLPurifier/Printer/ConfigForm.php'; -require 'HTMLPurifier/Printer/HTMLDefinition.php'; require 'HTMLPurifier/Strategy/Composite.php'; require 'HTMLPurifier/Strategy/Core.php'; require 'HTMLPurifier/Strategy/FixNesting.php'; diff --git a/library/HTMLPurifier.safe-includes.php b/library/HTMLPurifier.safe-includes.php index b2a1ab37..b4b423d1 100644 --- a/library/HTMLPurifier.safe-includes.php +++ b/library/HTMLPurifier.safe-includes.php @@ -49,7 +49,6 @@ require_once $__dir . '/HTMLPurifier/Language.php'; require_once $__dir . '/HTMLPurifier/LanguageFactory.php'; require_once $__dir . '/HTMLPurifier/Lexer.php'; require_once $__dir . '/HTMLPurifier/PercentEncoder.php'; -require_once $__dir . '/HTMLPurifier/Printer.php'; require_once $__dir . '/HTMLPurifier/Strategy.php'; require_once $__dir . '/HTMLPurifier/StringHash.php'; require_once $__dir . '/HTMLPurifier/StringHashParser.php'; @@ -121,15 +120,6 @@ require_once $__dir . '/HTMLPurifier/ChildDef/Table.php'; require_once $__dir . '/HTMLPurifier/ConfigDef/Directive.php'; require_once $__dir . '/HTMLPurifier/ConfigDef/DirectiveAlias.php'; require_once $__dir . '/HTMLPurifier/ConfigDef/Namespace.php'; -require_once $__dir . '/HTMLPurifier/ConfigSchema/Exception.php'; -require_once $__dir . '/HTMLPurifier/ConfigSchema/Interchange.php'; -require_once $__dir . '/HTMLPurifier/ConfigSchema/InterchangeBuilder.php'; -require_once $__dir . '/HTMLPurifier/ConfigSchema/Validator.php'; -require_once $__dir . '/HTMLPurifier/ConfigSchema/ValidatorAtom.php'; -require_once $__dir . '/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php'; -require_once $__dir . '/HTMLPurifier/ConfigSchema/Interchange/Directive.php'; -require_once $__dir . '/HTMLPurifier/ConfigSchema/Interchange/Id.php'; -require_once $__dir . '/HTMLPurifier/ConfigSchema/Interchange/Namespace.php'; require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator.php'; require_once $__dir . '/HTMLPurifier/DefinitionCache/Null.php'; require_once $__dir . '/HTMLPurifier/DefinitionCache/Serializer.php'; @@ -164,9 +154,6 @@ require_once $__dir . '/HTMLPurifier/Injector/Linkify.php'; require_once $__dir . '/HTMLPurifier/Injector/PurifierLinkify.php'; require_once $__dir . '/HTMLPurifier/Lexer/DOMLex.php'; require_once $__dir . '/HTMLPurifier/Lexer/DirectLex.php'; -require_once $__dir . '/HTMLPurifier/Printer/CSSDefinition.php'; -require_once $__dir . '/HTMLPurifier/Printer/ConfigForm.php'; -require_once $__dir . '/HTMLPurifier/Printer/HTMLDefinition.php'; require_once $__dir . '/HTMLPurifier/Strategy/Composite.php'; require_once $__dir . '/HTMLPurifier/Strategy/Core.php'; require_once $__dir . '/HTMLPurifier/Strategy/FixNesting.php'; diff --git a/tests/HTMLPurifier/ConfigSchemaTest.php b/tests/HTMLPurifier/ConfigSchemaTest.php index df757ee1..858a0cf3 100644 --- a/tests/HTMLPurifier/ConfigSchemaTest.php +++ b/tests/HTMLPurifier/ConfigSchemaTest.php @@ -9,10 +9,6 @@ class HTMLPurifier_ConfigSchemaTest extends HTMLPurifier_Harness $this->schema = new HTMLPurifier_ConfigSchema(); } - function tearDown() { - tally_errors($this); - } - function test_defineNamespace() { $this->schema->addNamespace('http'); $this->assertIdentical($this->schema->info['http'], array()); diff --git a/tests/HTMLPurifier/ConfigTest.php b/tests/HTMLPurifier/ConfigTest.php index 2a74c395..8922ca20 100644 --- a/tests/HTMLPurifier/ConfigTest.php +++ b/tests/HTMLPurifier/ConfigTest.php @@ -10,10 +10,6 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness $this->schema = new HTMLPurifier_ConfigSchema(); } - function tearDown() { - tally_errors($this); - } - // test functionality based on ConfigSchema function testNormal() { @@ -129,7 +125,7 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness function testNull() { $this->schema->addNamespace('ReportCard'); - $this->schema->add('ReportCard', 'English', null, 'string', false); + $this->schema->add('ReportCard', 'English', null, 'string', true); $this->schema->add('ReportCard', 'Absences', 0, 'int', false); $config = new HTMLPurifier_Config($this->schema); @@ -266,7 +262,7 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness function test_getDefinition() { $this->schema->addNamespace('Cache', 'Cache stuff'); - $this->schema->add('Cache', 'DefinitionImpl', null, 'string/null', 'Cache?'); + $this->schema->add('Cache', 'DefinitionImpl', null, 'string', true); $this->schema->addNamespace('Crust', 'Krusty Krabs'); $config = new HTMLPurifier_Config($this->schema); $this->expectError("Definition of Crust type not supported"); @@ -361,7 +357,7 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness } - function __onlytest_loadArrayFromForm() { + function test_loadArrayFromForm() { $this->schema->addNamespace('Pancake'); $this->schema->add('Pancake', 'Mix', 'buttermilk', 'string', false); diff --git a/tests/HTMLPurifier/Harness.php b/tests/HTMLPurifier/Harness.php index d616320e..fe7e8d05 100644 --- a/tests/HTMLPurifier/Harness.php +++ b/tests/HTMLPurifier/Harness.php @@ -64,6 +64,7 @@ class HTMLPurifier_Harness extends UnitTestCase // __onlytest makes only one test get triggered foreach (get_class_methods(get_class($this)) as $method) { if (strtolower(substr($method, 0, 10)) == '__onlytest') { + $this->_reporter->paintSkip('All test methods in ' . $this->_label . ' besides ' . $method); return array($method); } } diff --git a/tests/common.php b/tests/common.php index a95a1fab..72d65b44 100644 --- a/tests/common.php +++ b/tests/common.php @@ -64,7 +64,6 @@ require '../extras/HTMLPurifierExtras.auto.php'; // load SimpleTest addon functions require 'generate_mock_once.func.php'; require 'path2class.func.php'; -require 'tally_errors.func.php'; // compat /** * Arguments parser, is cli and web agnostic. diff --git a/tests/index.php b/tests/index.php index f9a3ab3e..266e04bf 100755 --- a/tests/index.php +++ b/tests/index.php @@ -145,7 +145,6 @@ if ($AC['file']) { } } -// we can't use addTestFile because SimpleTest chokes on E_STRICT warnings if ($AC['file']) { $test = new TestSuite($AC['file']); diff --git a/tests/tally_errors.func.php b/tests/tally_errors.func.php deleted file mode 100644 index 562d69b9..00000000 --- a/tests/tally_errors.func.php +++ /dev/null @@ -1,17 +0,0 @@ -get('SimpleErrorQueue'); - if (!isset($queue->_expectation_queue)) return; // fut-compat - foreach ($queue->_expectation_queue as $e) { - if (count($e) != 2) return; // fut-compat - if (!isset($e[0])) return; // fut-compat - $e[0]->_dumper = new SimpleDumper(); - $test->fail('Error expectation not fulfilled: ' . - $e[0]->testMessage(null)); - } - $queue->_expectation_queue = array(); -} -