mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-03 05:11:52 +00:00
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
This commit is contained in:
parent
b997076dfa
commit
119c70fc05
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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());
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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']);
|
||||
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
function tally_errors($test) {
|
||||
// BRITTLE: relies on private code to work
|
||||
$context = &SimpleTest::getContext();
|
||||
$queue = &$context->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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user