PATH:
home
/
letacommog
/
letaweb
/
admin
/
classes
/
htmlpurifier
/
tests
/
HTMLPurifier
<?php class HTMLPurifier_ElementDefTest extends HTMLPurifier_Harness { public function test_mergeIn() { $def1 = new HTMLPurifier_ElementDef(); $def2 = new HTMLPurifier_ElementDef(); $def3 = new HTMLPurifier_ElementDef(); $old = 1; $new = 2; $overloaded_old = 3; $overloaded_new = 4; $removed = 5; $def1->standalone = true; $def1->attr = array( 0 => array('old-include'), 'old-attr' => $old, 'overloaded-attr' => $overloaded_old, 'removed-attr' => $removed, ); $def1->attr_transform_pre = $def1->attr_transform_post = array( 'old-transform' => $old, 'overloaded-transform' => $overloaded_old, 'removed-transform' => $removed, ); $def1->child = $overloaded_old; $def1->content_model = 'old'; $def1->content_model_type = $overloaded_old; $def1->descendants_are_inline = false; $def1->excludes = array( 'old' => true, 'removed-old' => true, ); $def2->standalone = false; $def2->attr = array( 0 => array('new-include'), 'new-attr' => $new, 'overloaded-attr' => $overloaded_new, 'removed-attr' => false, ); $def2->attr_transform_pre = $def2->attr_transform_post = array( 'new-transform' => $new, 'overloaded-transform' => $overloaded_new, 'removed-transform' => false, ); $def2->child = $new; $def2->content_model = '#SUPER | new'; $def2->content_model_type = $overloaded_new; $def2->descendants_are_inline = true; $def2->excludes = array( 'new' => true, 'removed-old' => false, ); $def1->mergeIn($def2); $def1->mergeIn($def3); // empty, has no effect $this->assertIdentical($def1->standalone, true); $this->assertIdentical($def1->attr, array( 0 => array('old-include', 'new-include'), 'old-attr' => $old, 'overloaded-attr' => $overloaded_new, 'new-attr' => $new, )); $this->assertIdentical($def1->attr_transform_pre, $def1->attr_transform_post); $this->assertIdentical($def1->attr_transform_pre, array( 'old-transform' => $old, 'overloaded-transform' => $overloaded_new, 'new-transform' => $new, )); $this->assertIdentical($def1->child, $new); $this->assertIdentical($def1->content_model, 'old | new'); $this->assertIdentical($def1->content_model_type, $overloaded_new); $this->assertIdentical($def1->descendants_are_inline, true); $this->assertIdentical($def1->excludes, array( 'old' => true, 'new' => true, )); } } // vim: et sw=4 sts=4
[+]
..
[+]
AttrTransform
[-] HTMLModuleTest.php
[edit]
[-] HTMLModuleManagerTest.php
[edit]
[-] VarParserHarness.php
[edit]
[-] EntityParserTest.php
[edit]
[-] HTMLT.php
[edit]
[-] IDAccumulatorTest.php
[edit]
[-] LengthTest.php
[edit]
[-] ChildDefHarness.php
[edit]
[+]
SimpleTest
[-] ConfigSchemaTest.php
[edit]
[-] Harness.php
[edit]
[-] EntityLookupTest.php
[edit]
[-] URISchemeRegistryTest.php
[edit]
[+]
ConfigSchema
[-] URIDefinitionTest.php
[edit]
[-] ErrorCollectorEMock.php
[edit]
[+]
Filter
[-] ErrorsHarness.php
[edit]
[-] HTMLModuleHarness.php
[edit]
[-] InjectorHarness.php
[edit]
[-] AttrTransformHarness.php
[edit]
[-] URIFilterHarness.php
[edit]
[-] LanguageFactoryTest.php
[edit]
[+]
PHPT
[+]
Injector
[-] UnitConverterTest.php
[edit]
[-] TokenTest.php
[edit]
[-] LexerTest.php
[edit]
[-] GeneratorTest.php
[edit]
[-] DefinitionTestable.php
[edit]
[-] AttrDefTest.php
[edit]
[-] StringHashParserTest.php
[edit]
[+]
AttrDef
[-] HTMLDefinitionTest.php
[edit]
[-] DefinitionCacheTest.php
[edit]
[+]
HTMLT
[-] ConfigTest-loadIni.ini
[edit]
[+]
VarParser
[-] URISchemeTest.php
[edit]
[-] StrategyHarness.php
[edit]
[+]
ChildDef
[-] AttrDefHarness.php
[edit]
[-] AttrTransformTest.php
[edit]
[-] URIParserTest.php
[edit]
[+]
DefinitionCache
[-] DefinitionTest.php
[edit]
[-] TokenFactoryTest.php
[edit]
[-] ElementDefTest.php
[edit]
[-] DefinitionCacheFactoryTest.php
[edit]
[-] StringHashTest.php
[edit]
[-] ContextTest.php
[edit]
[-] URITest.php
[edit]
[-] ConfigTest.php
[edit]
[-] AttrValidator_ErrorsTest.php
[edit]
[-] URIHarness.php
[edit]
[+]
StringHashParser
[+]
HTMLModule
[-] LanguageTest.php
[edit]
[+]
Strategy
[-] DoctypeRegistryTest.php
[edit]
[-] AttrTypesTest.php
[edit]
[-] PercentEncoderTest.php
[edit]
[-] TagTransformTest.php
[edit]
[-] EncoderTest.php
[edit]
[+]
URIFilter
[-] PropertyListTest.php
[edit]
[-] ConfigTest-create.ini
[edit]
[-] ErrorCollectorTest.php
[edit]
[-] ConfigTest-finalize.ini
[edit]
[+]
Lexer
[-] ComplexHarness.php
[edit]
[-] DefinitionCacheHarness.php
[edit]
[-] AttrCollectionsTest.php
[edit]