mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-03 05:11:52 +00:00
Rewire test runner to use full path to test file, this means we can introduce new namespaces.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1102 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
ef51f8681a
commit
bd8ecdd268
@ -4,7 +4,7 @@ require_once 'HTMLPurifier.php';
|
||||
|
||||
// integration test
|
||||
|
||||
class HTMLPurifier_Test extends UnitTestCase
|
||||
class HTMLPurifierTest extends UnitTestCase
|
||||
{
|
||||
var $purifier;
|
||||
|
@ -38,8 +38,7 @@ if ( is_string($GLOBALS['HTMLPurifierTest']['PEAR']) ) {
|
||||
}
|
||||
|
||||
// initialize and load HTML Purifier
|
||||
set_include_path('../library' . PATH_SEPARATOR . get_include_path());
|
||||
require_once 'HTMLPurifier.php';
|
||||
require_once '../library/HTMLPurifier.auto.php';
|
||||
|
||||
// load tests
|
||||
$test_files = array();
|
||||
@ -61,19 +60,17 @@ if (isset($_GET['f']) && isset($test_file_lookup[$_GET['f']])) {
|
||||
// we can't use addTestFile because SimpleTest chokes on E_STRICT warnings
|
||||
if ($test_file = $GLOBALS['HTMLPurifierTest']['File']) {
|
||||
|
||||
$test = new GroupTest($test_file . ' - HTML Purifier');
|
||||
$path = 'HTMLPurifier/' . $test_file;
|
||||
require_once $path;
|
||||
$test->addTestClass(path2class($path));
|
||||
$test = new GroupTest($test_file);
|
||||
require_once $test_file;
|
||||
$test->addTestClass(path2class($test_file));
|
||||
|
||||
} else {
|
||||
|
||||
$test = new GroupTest('All Tests - HTML Purifier');
|
||||
$test = new GroupTest('All Tests');
|
||||
|
||||
foreach ($test_files as $test_file) {
|
||||
$path = 'HTMLPurifier/' . $test_file;
|
||||
require_once $path;
|
||||
$test->addTestClass(path2class($path));
|
||||
require_once $test_file;
|
||||
$test->addTestClass(path2class($test_file));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,94 +3,101 @@
|
||||
if (!defined('HTMLPurifierTest')) exit;
|
||||
|
||||
// define callable test files (sorted alphabetically)
|
||||
$test_files[] = 'AttrCollectionsTest.php';
|
||||
$test_files[] = 'AttrDef/CSS/BackgroundPositionTest.php';
|
||||
$test_files[] = 'AttrDef/CSS/BackgroundTest.php';
|
||||
$test_files[] = 'AttrDef/CSS/BorderTest.php';
|
||||
$test_files[] = 'AttrDef/CSS/ColorTest.php';
|
||||
$test_files[] = 'AttrDef/CSS/CompositeTest.php';
|
||||
$test_files[] = 'AttrDef/CSS/FontFamilyTest.php';
|
||||
$test_files[] = 'AttrDef/CSS/FontTest.php';
|
||||
$test_files[] = 'AttrDef/CSS/LengthTest.php';
|
||||
$test_files[] = 'AttrDef/CSS/ListStyleTest.php';
|
||||
$test_files[] = 'AttrDef/CSS/MultipleTest.php';
|
||||
$test_files[] = 'AttrDef/CSS/NumberTest.php';
|
||||
$test_files[] = 'AttrDef/CSS/PercentageTest.php';
|
||||
$test_files[] = 'AttrDef/CSS/TextDecorationTest.php';
|
||||
$test_files[] = 'AttrDef/CSS/URITest.php';
|
||||
$test_files[] = 'AttrDef/CSSTest.php';
|
||||
$test_files[] = 'AttrDef/EnumTest.php';
|
||||
$test_files[] = 'AttrDef/HTML/ColorTest.php';
|
||||
$test_files[] = 'AttrDef/HTML/IDTest.php';
|
||||
$test_files[] = 'AttrDef/HTML/LengthTest.php';
|
||||
$test_files[] = 'AttrDef/HTML/FrameTargetTest.php';
|
||||
$test_files[] = 'AttrDef/HTML/MultiLengthTest.php';
|
||||
$test_files[] = 'AttrDef/HTML/NmtokensTest.php';
|
||||
$test_files[] = 'AttrDef/HTML/PixelsTest.php';
|
||||
$test_files[] = 'AttrDef/HTML/LinkTypesTest.php';
|
||||
$test_files[] = 'AttrDef/IntegerTest.php';
|
||||
$test_files[] = 'AttrDef/LangTest.php';
|
||||
$test_files[] = 'AttrDef/TextTest.php';
|
||||
$test_files[] = 'AttrDef/URI/Email/SimpleCheckTest.php';
|
||||
$test_files[] = 'AttrDef/URI/HostTest.php';
|
||||
$test_files[] = 'AttrDef/URI/IPv4Test.php';
|
||||
$test_files[] = 'AttrDef/URI/IPv6Test.php';
|
||||
$test_files[] = 'AttrDef/URITest.php';
|
||||
$test_files[] = 'AttrDefTest.php';
|
||||
$test_files[] = 'AttrTransformTest.php';
|
||||
$test_files[] = 'AttrTransform/BdoDirTest.php';
|
||||
$test_files[] = 'AttrTransform/BgColorTest.php';
|
||||
$test_files[] = 'AttrTransform/BoolToCSSTest.php';
|
||||
$test_files[] = 'AttrTransform/BorderTest.php';
|
||||
$test_files[] = 'AttrTransform/EnumToCSSTest.php';
|
||||
$test_files[] = 'AttrTransform/ImgRequiredTest.php';
|
||||
$test_files[] = 'AttrTransform/ImgSpaceTest.php';
|
||||
$test_files[] = 'AttrTransform/LangTest.php';
|
||||
$test_files[] = 'AttrTransform/LengthTest.php';
|
||||
$test_files[] = 'AttrTransform/NameTest.php';
|
||||
$test_files[] = 'AttrTypesTest.php';
|
||||
$test_files[] = 'ChildDef/ChameleonTest.php';
|
||||
$test_files[] = 'ChildDef/CustomTest.php';
|
||||
$test_files[] = 'ChildDef/OptionalTest.php';
|
||||
$test_files[] = 'ChildDef/RequiredTest.php';
|
||||
$test_files[] = 'ChildDef/StrictBlockquoteTest.php';
|
||||
$test_files[] = 'ChildDef/TableTest.php';
|
||||
$test_files[] = 'ConfigSchemaTest.php';
|
||||
$test_files[] = 'ConfigTest.php';
|
||||
$test_files[] = 'ContextTest.php';
|
||||
$test_files[] = 'DefinitionCacheTest.php';
|
||||
$test_files[] = 'DefinitionCache/SerializerTest.php';
|
||||
$test_files[] = 'DefinitionTest.php';
|
||||
$test_files[] = 'DoctypeRegistryTest.php';
|
||||
$test_files[] = 'ElementDefTest.php';
|
||||
$test_files[] = 'EncoderTest.php';
|
||||
$test_files[] = 'EntityLookupTest.php';
|
||||
$test_files[] = 'EntityParserTest.php';
|
||||
$test_files[] = 'GeneratorTest.php';
|
||||
$test_files[] = 'HTMLModuleManagerTest.php';
|
||||
$test_files[] = 'HTMLModuleTest.php';
|
||||
$test_files[] = 'HTMLModule/ScriptingTest.php';
|
||||
$test_files[] = 'HTMLModule/TidyTest.php';
|
||||
$test_files[] = 'IDAccumulatorTest.php';
|
||||
$test_files[] = 'LanguageFactoryTest.php';
|
||||
$test_files[] = 'LanguageTest.php';
|
||||
$test_files[] = 'Lexer/DirectLexTest.php';
|
||||
$test_files[] = 'LexerTest.php';
|
||||
$test_files[] = 'PercentEncoderTest.php';
|
||||
$test_files[] = 'Strategy/CompositeTest.php';
|
||||
$test_files[] = 'Strategy/CoreTest.php';
|
||||
$test_files[] = 'Strategy/FixNestingTest.php';
|
||||
$test_files[] = 'Strategy/MakeWellFormedTest.php';
|
||||
$test_files[] = 'Strategy/RemoveForeignElementsTest.php';
|
||||
$test_files[] = 'Strategy/ValidateAttributesTest.php';
|
||||
$test_files[] = 'TagTransformTest.php';
|
||||
$test_files[] = 'Test.php';
|
||||
$test_files[] = 'TokenTest.php';
|
||||
$test_files[] = 'URISchemeRegistryTest.php';
|
||||
$test_files[] = 'URISchemeTest.php';
|
||||
|
||||
// HTML Purifier main library
|
||||
|
||||
$test_files[] = 'HTMLPurifier/AttrCollectionsTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSS/BackgroundTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSS/BorderTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSS/ColorTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSS/CompositeTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSS/FontFamilyTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSS/FontTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSS/LengthTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSS/ListStyleTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSS/MultipleTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSS/NumberTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSS/PercentageTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSS/TextDecorationTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSS/URITest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/CSSTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/EnumTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/HTML/ColorTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/HTML/IDTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/HTML/LengthTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/HTML/FrameTargetTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/HTML/MultiLengthTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/HTML/NmtokensTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/HTML/PixelsTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/HTML/LinkTypesTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/IntegerTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/LangTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/TextTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/URI/Email/SimpleCheckTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/URI/HostTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/URI/IPv4Test.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/URI/IPv6Test.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDef/URITest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrDefTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrTransformTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrTransform/BdoDirTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrTransform/BgColorTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrTransform/BoolToCSSTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrTransform/BorderTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrTransform/EnumToCSSTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrTransform/ImgRequiredTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrTransform/ImgSpaceTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrTransform/LangTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrTransform/LengthTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrTransform/NameTest.php';
|
||||
$test_files[] = 'HTMLPurifier/AttrTypesTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ChildDef/ChameleonTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ChildDef/CustomTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ChildDef/OptionalTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ChildDef/RequiredTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ChildDef/StrictBlockquoteTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ChildDef/TableTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ConfigSchemaTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ConfigTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ContextTest.php';
|
||||
$test_files[] = 'HTMLPurifier/DefinitionCacheTest.php';
|
||||
$test_files[] = 'HTMLPurifier/DefinitionCache/SerializerTest.php';
|
||||
$test_files[] = 'HTMLPurifier/DefinitionTest.php';
|
||||
$test_files[] = 'HTMLPurifier/DoctypeRegistryTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ElementDefTest.php';
|
||||
$test_files[] = 'HTMLPurifier/EncoderTest.php';
|
||||
$test_files[] = 'HTMLPurifier/EntityLookupTest.php';
|
||||
$test_files[] = 'HTMLPurifier/EntityParserTest.php';
|
||||
$test_files[] = 'HTMLPurifier/GeneratorTest.php';
|
||||
$test_files[] = 'HTMLPurifier/HTMLModuleManagerTest.php';
|
||||
$test_files[] = 'HTMLPurifier/HTMLModuleTest.php';
|
||||
$test_files[] = 'HTMLPurifier/HTMLModule/ScriptingTest.php';
|
||||
$test_files[] = 'HTMLPurifier/HTMLModule/TidyTest.php';
|
||||
$test_files[] = 'HTMLPurifier/IDAccumulatorTest.php';
|
||||
$test_files[] = 'HTMLPurifier/LanguageFactoryTest.php';
|
||||
$test_files[] = 'HTMLPurifier/LanguageTest.php';
|
||||
$test_files[] = 'HTMLPurifier/Lexer/DirectLexTest.php';
|
||||
$test_files[] = 'HTMLPurifier/LexerTest.php';
|
||||
$test_files[] = 'HTMLPurifier/PercentEncoderTest.php';
|
||||
$test_files[] = 'HTMLPurifier/Strategy/CompositeTest.php';
|
||||
$test_files[] = 'HTMLPurifier/Strategy/CoreTest.php';
|
||||
$test_files[] = 'HTMLPurifier/Strategy/FixNestingTest.php';
|
||||
$test_files[] = 'HTMLPurifier/Strategy/MakeWellFormedTest.php';
|
||||
$test_files[] = 'HTMLPurifier/Strategy/RemoveForeignElementsTest.php';
|
||||
$test_files[] = 'HTMLPurifier/Strategy/ValidateAttributesTest.php';
|
||||
$test_files[] = 'HTMLPurifier/TagTransformTest.php';
|
||||
$test_files[] = 'HTMLPurifier/TokenTest.php';
|
||||
$test_files[] = 'HTMLPurifier/URISchemeRegistryTest.php';
|
||||
$test_files[] = 'HTMLPurifier/URISchemeTest.php';
|
||||
$test_files[] = 'HTMLPurifierTest.php';
|
||||
|
||||
if (version_compare(PHP_VERSION, '5', '>=')) {
|
||||
$test_files[] = 'TokenFactoryTest.php';
|
||||
$test_files[] = 'HTMLPurifier/TokenFactoryTest.php';
|
||||
}
|
||||
|
||||
// ConfigDoc auxiliary library
|
||||
|
||||
// ... none yet
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user