From fbc595ebed59554ee50b467a867a76a8bb4ba430 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Mon, 18 Feb 2008 04:41:42 +0000 Subject: [PATCH] Remove includes from unit tests. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1569 48356398-32a2-884e-a903-53898d9a118a --- TODO | 2 -- maintenance/generate-standalone.php | 16 ---------------- maintenance/remove-require-once.php | 6 +++--- tests/HTMLPurifier/AttrCollectionsTest.php | 2 -- .../HTMLPurifier/AttrDef/CSS/AlphaValueTest.php | 3 --- .../AttrDef/CSS/BackgroundPositionTest.php | 3 --- .../HTMLPurifier/AttrDef/CSS/BackgroundTest.php | 3 --- tests/HTMLPurifier/AttrDef/CSS/BorderTest.php | 2 -- tests/HTMLPurifier/AttrDef/CSS/ColorTest.php | 3 --- tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php | 3 --- tests/HTMLPurifier/AttrDef/CSS/FilterTest.php | 3 --- .../HTMLPurifier/AttrDef/CSS/FontFamilyTest.php | 3 --- tests/HTMLPurifier/AttrDef/CSS/FontTest.php | 3 --- tests/HTMLPurifier/AttrDef/CSS/LengthTest.php | 3 --- tests/HTMLPurifier/AttrDef/CSS/ListStyleTest.php | 3 --- tests/HTMLPurifier/AttrDef/CSS/MultipleTest.php | 5 ----- tests/HTMLPurifier/AttrDef/CSS/NumberTest.php | 3 --- .../HTMLPurifier/AttrDef/CSS/PercentageTest.php | 3 --- .../AttrDef/CSS/TextDecorationTest.php | 3 --- tests/HTMLPurifier/AttrDef/CSS/URITest.php | 3 --- tests/HTMLPurifier/AttrDef/CSSTest.php | 3 --- tests/HTMLPurifier/AttrDef/EnumTest.php | 3 --- tests/HTMLPurifier/AttrDef/HTML/BoolTest.php | 3 --- tests/HTMLPurifier/AttrDef/HTML/ColorTest.php | 3 --- .../AttrDef/HTML/FrameTargetTest.php | 3 --- tests/HTMLPurifier/AttrDef/HTML/IDTest.php | 4 ---- tests/HTMLPurifier/AttrDef/HTML/LengthTest.php | 3 --- .../HTMLPurifier/AttrDef/HTML/LinkTypesTest.php | 3 --- .../AttrDef/HTML/MultiLengthTest.php | 3 --- tests/HTMLPurifier/AttrDef/HTML/NmtokensTest.php | 3 --- tests/HTMLPurifier/AttrDef/HTML/PixelsTest.php | 3 --- tests/HTMLPurifier/AttrDef/IntegerTest.php | 3 --- tests/HTMLPurifier/AttrDef/LangTest.php | 3 --- tests/HTMLPurifier/AttrDef/TextTest.php | 3 --- .../AttrDef/URI/Email/SimpleCheckTest.php | 3 --- tests/HTMLPurifier/AttrDef/URI/EmailHarness.php | 3 --- tests/HTMLPurifier/AttrDef/URI/HostTest.php | 3 --- tests/HTMLPurifier/AttrDef/URI/IPv4Test.php | 3 --- tests/HTMLPurifier/AttrDef/URI/IPv6Test.php | 3 --- tests/HTMLPurifier/AttrDef/URITest.php | 4 ---- tests/HTMLPurifier/AttrDefTest.php | 2 -- tests/HTMLPurifier/AttrTransform/BdoDirTest.php | 3 --- tests/HTMLPurifier/AttrTransform/BgColorTest.php | 3 --- .../HTMLPurifier/AttrTransform/BoolToCSSTest.php | 3 --- tests/HTMLPurifier/AttrTransform/BorderTest.php | 4 ---- .../HTMLPurifier/AttrTransform/EnumToCSSTest.php | 3 --- .../AttrTransform/ImgRequiredTest.php | 3 --- .../HTMLPurifier/AttrTransform/ImgSpaceTest.php | 4 ---- tests/HTMLPurifier/AttrTransform/LangTest.php | 4 ---- tests/HTMLPurifier/AttrTransform/LengthTest.php | 3 --- tests/HTMLPurifier/AttrTransform/NameTest.php | 3 --- tests/HTMLPurifier/AttrTransformHarness.php | 2 -- tests/HTMLPurifier/AttrTransformTest.php | 2 -- tests/HTMLPurifier/AttrTypesTest.php | 2 -- tests/HTMLPurifier/AttrValidator_ErrorsTest.php | 3 --- tests/HTMLPurifier/ChildDef/ChameleonTest.php | 3 --- tests/HTMLPurifier/ChildDef/CustomTest.php | 3 --- tests/HTMLPurifier/ChildDef/OptionalTest.php | 3 --- tests/HTMLPurifier/ChildDef/RequiredTest.php | 3 --- .../ChildDef/StrictBlockquoteTest.php | 3 --- tests/HTMLPurifier/ChildDef/TableTest.php | 3 --- tests/HTMLPurifier/ChildDefHarness.php | 3 --- tests/HTMLPurifier/ComplexHarness.php | 2 -- tests/HTMLPurifier/ConfigSchemaTest.php | 2 -- tests/HTMLPurifier/ConfigTest.php | 2 -- tests/HTMLPurifier/ContextTest.php | 4 ---- .../DefinitionCache/Decorator/CleanupTest.php | 3 --- .../DefinitionCache/Decorator/MemoryTest.php | 3 --- .../DefinitionCache/DecoratorHarness.php | 3 --- .../DefinitionCache/DecoratorTest.php | 3 --- .../DefinitionCache/SerializerTest.php | 3 --- .../HTMLPurifier/DefinitionCacheFactoryTest.php | 2 -- tests/HTMLPurifier/DefinitionCacheHarness.php | 2 -- tests/HTMLPurifier/DefinitionCacheTest.php | 2 -- tests/HTMLPurifier/DefinitionTest.php | 3 --- tests/HTMLPurifier/DoctypeRegistryTest.php | 2 -- tests/HTMLPurifier/ElementDefTest.php | 2 -- tests/HTMLPurifier/EncoderTest.php | 2 -- tests/HTMLPurifier/EntityLookupTest.php | 2 -- tests/HTMLPurifier/EntityParserTest.php | 2 -- tests/HTMLPurifier/ErrorCollectorEMock.php | 2 -- tests/HTMLPurifier/ErrorCollectorTest.php | 2 -- tests/HTMLPurifier/ErrorsHarness.php | 3 --- .../Filter/ExtractStyleBlocksTest.php | 2 -- tests/HTMLPurifier/GeneratorTest.php | 5 ----- tests/HTMLPurifier/HTMLDefinitionTest.php | 2 -- tests/HTMLPurifier/HTMLModule/ObjectTest.php | 2 -- tests/HTMLPurifier/HTMLModule/RubyTest.php | 2 -- tests/HTMLPurifier/HTMLModule/ScriptingTest.php | 2 -- tests/HTMLPurifier/HTMLModule/TidyTest.php | 2 -- tests/HTMLPurifier/HTMLModuleHarness.php | 3 --- tests/HTMLPurifier/HTMLModuleManagerTest.php | 2 -- tests/HTMLPurifier/HTMLModuleTest.php | 3 --- tests/HTMLPurifier/Harness.php | 2 -- tests/HTMLPurifier/IDAccumulatorTest.php | 2 -- .../HTMLPurifier/Injector/AutoParagraphTest.php | 3 --- tests/HTMLPurifier/Injector/LinkifyTest.php | 3 --- .../Injector/PurifierLinkifyTest.php | 3 --- tests/HTMLPurifier/InjectorHarness.php | 3 --- tests/HTMLPurifier/LanguageFactoryTest.php | 2 -- tests/HTMLPurifier/LanguageTest.php | 2 -- tests/HTMLPurifier/Lexer/DirectLexTest.php | 2 -- .../HTMLPurifier/Lexer/DirectLex_ErrorsTest.php | 3 --- tests/HTMLPurifier/LexerTest.php | 2 -- tests/HTMLPurifier/PercentEncoderTest.php | 2 -- tests/HTMLPurifier/Strategy/CompositeTest.php | 4 ---- tests/HTMLPurifier/Strategy/CoreTest.php | 3 --- tests/HTMLPurifier/Strategy/ErrorsHarness.php | 2 -- tests/HTMLPurifier/Strategy/FixNestingTest.php | 3 --- .../Strategy/FixNesting_ErrorsTest.php | 3 --- .../HTMLPurifier/Strategy/MakeWellFormedTest.php | 3 --- .../Strategy/MakeWellFormed_ErrorsTest.php | 3 --- .../Strategy/MakeWellFormed_InjectorTest.php | 3 --- .../Strategy/RemoveForeignElementsTest.php | 3 --- .../RemoveForeignElements_ErrorsTest.php | 3 --- .../Strategy/RemoveForeignElements_TidyTest.php | 3 --- .../Strategy/ValidateAttributesTest.php | 3 --- .../Strategy/ValidateAttributes_IDTest.php | 3 --- .../Strategy/ValidateAttributes_TidyTest.php | 3 --- tests/HTMLPurifier/StrategyHarness.php | 2 -- tests/HTMLPurifier/TagTransformTest.php | 5 ----- tests/HTMLPurifier/TokenFactoryTest.php | 2 -- tests/HTMLPurifier/TokenTest.php | 2 -- tests/HTMLPurifier/URIDefinitionTest.php | 3 --- .../URIFilter/DisableExternalResourcesTest.php | 3 --- .../URIFilter/DisableExternalTest.php | 3 --- .../HTMLPurifier/URIFilter/HostBlacklistTest.php | 3 --- .../HTMLPurifier/URIFilter/MakeAbsoluteTest.php | 3 --- tests/HTMLPurifier/URIFilterHarness.php | 2 -- tests/HTMLPurifier/URIHarness.php | 2 -- tests/HTMLPurifier/URIParserTest.php | 3 --- tests/HTMLPurifier/URISchemeRegistryTest.php | 2 -- tests/HTMLPurifier/URISchemeTest.php | 13 ------------- tests/HTMLPurifier/URITest.php | 3 --- tests/HTMLPurifierTest.php | 4 ---- tests/index.php | 6 ++++-- 136 files changed, 7 insertions(+), 403 deletions(-) diff --git a/TODO b/TODO index 61a9a534..a660862b 100644 --- a/TODO +++ b/TODO @@ -45,9 +45,7 @@ CONFIGDOC which files use what configuration IF IT AIN'T BROKE... - - Rename merge-library.php script - Create "super" script which performs all regeneration actions - - Remove all includes from unit tests, and remove blanks/ folder and generation - Simplify merge library script by removing recursion? (or other things) - Perhaps replace types with integer identifiers in ConfigSchema? (would be smaller, but not by much). diff --git a/maintenance/generate-standalone.php b/maintenance/generate-standalone.php index 0d60d927..bcd8340a 100755 --- a/maintenance/generate-standalone.php +++ b/maintenance/generate-standalone.php @@ -58,21 +58,6 @@ function remove_php_tags($text) { return substr($text, 5); } -/** - * Creates an appropriate blank file, recursively generating directories - * if necessary - * @param string $file Filename to create blank for - */ -function create_blank($file) { - global $FS; - $dir = dirname($file); - $base = realpath('../tests/blanks/') . DIRECTORY_SEPARATOR ; - if ($dir != '.') { - $FS->mkdirr($base . $dir); - } - file_put_contents($base . $file, ''); -} - /** * Copies the contents of a directory to the standalone directory * @param string $dir Directory to copy @@ -120,7 +105,6 @@ function replace_includes_callback($matches) { } if (isset($GLOBALS['loaded'][$file])) return ''; $GLOBALS['loaded'][$file] = true; - create_blank($file); return replace_includes(remove_php_tags(file_get_contents($file))); } diff --git a/maintenance/remove-require-once.php b/maintenance/remove-require-once.php index 98f70c70..6cb4ed71 100644 --- a/maintenance/remove-require-once.php +++ b/maintenance/remove-require-once.php @@ -5,8 +5,8 @@ chdir(dirname(__FILE__)); require_once 'common.php'; assertCli(); -echo "Please do not run this script. It is here for historical purposes only."; -exit; +//echo "Please do not run this script. It is here for historical purposes only."; +//exit; /** * @file @@ -16,7 +16,7 @@ exit; * This does not remove inline includes; those must be handled manually. */ -chdir(dirname(__FILE__) . '/../library/'); +chdir(dirname(__FILE__) . '/../tests/HTMLPurifier'); $FS = new FSTools(); $files = $FS->globr('.', '*.php'); diff --git a/tests/HTMLPurifier/AttrCollectionsTest.php b/tests/HTMLPurifier/AttrCollectionsTest.php index fb1bb758..eecb03c4 100644 --- a/tests/HTMLPurifier/AttrCollectionsTest.php +++ b/tests/HTMLPurifier/AttrCollectionsTest.php @@ -1,7 +1,5 @@ _loaded using something else */ diff --git a/tests/HTMLPurifier/Lexer/DirectLexTest.php b/tests/HTMLPurifier/Lexer/DirectLexTest.php index 4a149548..d39438d8 100644 --- a/tests/HTMLPurifier/Lexer/DirectLexTest.php +++ b/tests/HTMLPurifier/Lexer/DirectLexTest.php @@ -1,7 +1,5 @@