0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-01-03 05:11:52 +00:00

[3.1.0] Reconfigure tester to glob for test files using *Test.php pattern.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1585 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2008-03-02 02:05:47 +00:00
parent 8bda0c4dfb
commit fa6b6fe85f
4 changed files with 39 additions and 144 deletions

View File

@ -7,7 +7,7 @@ class HTMLPurifier_AttrDef_HTML_BoolTest extends HTMLPurifier_AttrDefHarness
$this->def = new HTMLPurifier_AttrDef_HTML_Bool('foo'); $this->def = new HTMLPurifier_AttrDef_HTML_Bool('foo');
$this->assertDef('foo'); $this->assertDef('foo');
$this->assertDef('', false); $this->assertDef('', false);
$this->assertDef('bar', false); $this->assertDef('bar', 'foo');
} }
function test_make() { function test_make() {

View File

@ -18,7 +18,7 @@ class HTMLPurifier_HTMLModule_ProprietaryTest extends HTMLPurifier_HTMLModuleHar
scrolldelay="3" scrolldelay="3"
scrollamount="5" scrollamount="5"
loop="4" loop="4"
bgcolor="red" bgcolor="#FF0000"
hspace="5" hspace="5"
vspace="3" vspace="3"
><div>Block</div><span>Inline</span>Text</marquee></span>' ><div>Block</div><span>Inline</span>Text</marquee></span>'

View File

@ -86,17 +86,35 @@ if (!$AC['disable-phpt']) {
} }
// load tests // load tests
$test_files = array(); $test_files = array();
$test_dirs = array();
$test_dirs_exclude = array();
$phpt_dirs = array(); $phpt_dirs = array();
require 'test_files.php'; // populates $test_files array require 'test_files.php'; // populates $test_files array
$FS = new FSTools();
// handle test dirs
foreach ($test_dirs as $dir) {
$raw_files = $FS->globr($dir, '*Test.php');
foreach ($raw_files as $file) {
$file = str_replace('\\', '/', $file);
if (isset($test_dirs_exclude[$file])) continue;
$test_files[] = $file;
}
}
// handle phpt files // handle phpt files
foreach ($phpt_dirs as $dir) { foreach ($phpt_dirs as $dir) {
$FS = new FSTools();
$phpt_files = $FS->globr($dir, '*.phpt'); $phpt_files = $FS->globr($dir, '*.phpt');
foreach ($phpt_files as $file) { foreach ($phpt_files as $file) {
$test_files[] = str_replace('\\', '/', $file); $test_files[] = str_replace('\\', '/', $file);
} }
} }
array_unique($test_files);
sort($test_files); // for the SELECT sort($test_files); // for the SELECT
$GLOBALS['HTMLPurifierTest']['Files'] = $test_files; // for the reporter $GLOBALS['HTMLPurifierTest']['Files'] = $test_files; // for the reporter
$test_file_lookup = array_flip($test_files); $test_file_lookup = array_flip($test_files);

View File

@ -5,150 +5,27 @@ if (!defined('HTMLPurifierTest')) exit;
// define callable test files (sorted alphabetically) // define callable test files (sorted alphabetically)
if (!$AC['only-phpt']) { if (!$AC['only-phpt']) {
// HTML Purifier main library // HTML Purifier main library
$test_dirs[] = 'HTMLPurifier';
$test_files[] = 'HTMLPurifier/AttrCollectionsTest.php'; $test_files[] = 'HTMLPurifierTest.php';
$test_files[] = 'HTMLPurifier/AttrDef/CSS/AlphaValueTest.php';
$test_files[] = 'HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php'; $test_dirs_exclude['HTMLPurifier/Filter/ExtractStyleBlocksTest.php'] = true;
$test_files[] = 'HTMLPurifier/AttrDef/CSS/BackgroundTest.php'; if ($csstidy_location) {
$test_files[] = 'HTMLPurifier/AttrDef/CSS/BorderTest.php'; $test_files[] = 'HTMLPurifier/Filter/ExtractStyleBlocksTest.php';
$test_files[] = 'HTMLPurifier/AttrDef/CSS/ColorTest.php'; }
$test_files[] = 'HTMLPurifier/AttrDef/CSS/CompositeTest.php';
$test_files[] = 'HTMLPurifier/AttrDef/CSS/FilterTest.php'; // ConfigDoc auxiliary library
$test_files[] = 'HTMLPurifier/AttrDef/CSS/FontFamilyTest.php'; if (version_compare(PHP_VERSION, '5.2', '>=')) {
$test_files[] = 'HTMLPurifier/AttrDef/CSS/FontTest.php'; $test_dirs[] = 'ConfigDoc';
$test_files[] = 'HTMLPurifier/AttrDef/CSS/ImportantDecoratorTest.php'; }
$test_files[] = 'HTMLPurifier/AttrDef/CSS/LengthTest.php';
$test_files[] = 'HTMLPurifier/AttrDef/CSS/ListStyleTest.php'; // FSTools auxiliary library
$test_files[] = 'HTMLPurifier/AttrDef/CSS/MultipleTest.php'; $test_dirs[] = 'FSTools';
$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/AttrValidator_ErrorsTest.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/ConfigSchema/InterchangeTest.php';
$test_files[] = 'HTMLPurifier/ConfigSchema/Interchange/Validator/IdExistsTest.php';
$test_files[] = 'HTMLPurifier/ConfigSchema/StringHashAdapterTest.php';
$test_files[] = 'HTMLPurifier/ConfigSchema/StringHashReverseAdapterTest.php';
$test_files[] = 'HTMLPurifier/ConfigSchema/StringHashParserTest.php';
$test_files[] = 'HTMLPurifier/ConfigSchema/StringHashTest.php';
$test_files[] = 'HTMLPurifier/ConfigTest.php';
$test_files[] = 'HTMLPurifier/ContextTest.php';
$test_files[] = 'HTMLPurifier/DefinitionCacheFactoryTest.php';
$test_files[] = 'HTMLPurifier/DefinitionCacheTest.php';
$test_files[] = 'HTMLPurifier/DefinitionCache/Decorator/CleanupTest.php';
$test_files[] = 'HTMLPurifier/DefinitionCache/Decorator/MemoryTest.php';
$test_files[] = 'HTMLPurifier/DefinitionCache/DecoratorTest.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/ErrorCollectorTest.php';
$test_files[] = 'HTMLPurifier/EncoderTest.php';
$test_files[] = 'HTMLPurifier/EntityLookupTest.php';
$test_files[] = 'HTMLPurifier/EntityParserTest.php';
$test_files[] = 'HTMLPurifier/GeneratorTest.php';
$test_files[] = 'HTMLPurifier/HTMLDefinitionTest.php';
$test_files[] = 'HTMLPurifier/HTMLModuleManagerTest.php';
$test_files[] = 'HTMLPurifier/HTMLModuleTest.php';
$test_files[] = 'HTMLPurifier/HTMLModule/ObjectTest.php';
$test_files[] = 'HTMLPurifier/HTMLModule/RubyTest.php';
$test_files[] = 'HTMLPurifier/HTMLModule/ScriptingTest.php';
$test_files[] = 'HTMLPurifier/HTMLModule/TidyTest.php';
$test_files[] = 'HTMLPurifier/IDAccumulatorTest.php';
$test_files[] = 'HTMLPurifier/Injector/AutoParagraphTest.php';
$test_files[] = 'HTMLPurifier/Injector/LinkifyTest.php';
$test_files[] = 'HTMLPurifier/Injector/PurifierLinkifyTest.php';
$test_files[] = 'HTMLPurifier/LanguageFactoryTest.php';
$test_files[] = 'HTMLPurifier/LanguageTest.php';
$test_files[] = 'HTMLPurifier/Lexer/DirectLexTest.php';
$test_files[] = 'HTMLPurifier/Lexer/DirectLex_ErrorsTest.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/FixNesting_ErrorsTest.php';
$test_files[] = 'HTMLPurifier/Strategy/MakeWellFormedTest.php';
$test_files[] = 'HTMLPurifier/Strategy/MakeWellFormed_ErrorsTest.php';
$test_files[] = 'HTMLPurifier/Strategy/MakeWellFormed_InjectorTest.php';
$test_files[] = 'HTMLPurifier/Strategy/RemoveForeignElementsTest.php';
$test_files[] = 'HTMLPurifier/Strategy/RemoveForeignElements_ErrorsTest.php';
$test_files[] = 'HTMLPurifier/Strategy/RemoveForeignElements_TidyTest.php';
$test_files[] = 'HTMLPurifier/Strategy/ValidateAttributesTest.php';
$test_files[] = 'HTMLPurifier/Strategy/ValidateAttributes_IDTest.php';
$test_files[] = 'HTMLPurifier/Strategy/ValidateAttributes_TidyTest.php';
$test_files[] = 'HTMLPurifier/TagTransformTest.php';
$test_files[] = 'HTMLPurifier/TokenFactoryTest.php';
$test_files[] = 'HTMLPurifier/TokenTest.php';
$test_files[] = 'HTMLPurifier/URIDefinitionTest.php';
$test_files[] = 'HTMLPurifier/URIFilter/DisableExternalTest.php';
$test_files[] = 'HTMLPurifier/URIFilter/DisableExternalResourcesTest.php';
$test_files[] = 'HTMLPurifier/URIFilter/HostBlacklistTest.php';
$test_files[] = 'HTMLPurifier/URIFilter/MakeAbsoluteTest.php';
$test_files[] = 'HTMLPurifier/URIParserTest.php';
$test_files[] = 'HTMLPurifier/URISchemeRegistryTest.php';
$test_files[] = 'HTMLPurifier/URISchemeTest.php';
$test_files[] = 'HTMLPurifier/URITest.php';
$test_files[] = 'HTMLPurifierTest.php';
if ($csstidy_location) {
$test_files[] = 'HTMLPurifier/Filter/ExtractStyleBlocksTest.php';
} }
// ConfigDoc auxiliary library
if (version_compare(PHP_VERSION, '5.2', '>=')) {
$test_files[] = 'ConfigDoc/DOM/DocumentTest.php';
}
// FSTools auxiliary library
$test_files[] = 'FSTools/FileTest.php';
} // end if ($AC['only-phpt'])
// PHPT tests // PHPT tests
if (!$AC['disable-phpt']) { if (!$AC['disable-phpt']) {
$phpt_dirs = array(); $phpt_dirs = array();
$phpt_dirs[] = 'HTMLPurifier/PHPT'; $phpt_dirs[] = 'HTMLPurifier/PHPT';