diff options
author | friendica <info@friendica.com> | 2012-07-18 03:59:10 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-07-18 03:59:10 -0700 |
commit | 22cf19e174bcee88b44968f2773d1bad2da2b54d (patch) | |
tree | f4e01db6f73754418438b020c2327e18c256653c /lib/htmlpurifier/tests/HTMLPurifier/AttrCollectionsTest.php | |
parent | 7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a (diff) | |
download | volse-hubzilla-22cf19e174bcee88b44968f2773d1bad2da2b54d.tar.gz volse-hubzilla-22cf19e174bcee88b44968f2773d1bad2da2b54d.tar.bz2 volse-hubzilla-22cf19e174bcee88b44968f2773d1bad2da2b54d.zip |
bad sync with github windows client
Diffstat (limited to 'lib/htmlpurifier/tests/HTMLPurifier/AttrCollectionsTest.php')
-rw-r--r-- | lib/htmlpurifier/tests/HTMLPurifier/AttrCollectionsTest.php | 134 |
1 files changed, 0 insertions, 134 deletions
diff --git a/lib/htmlpurifier/tests/HTMLPurifier/AttrCollectionsTest.php b/lib/htmlpurifier/tests/HTMLPurifier/AttrCollectionsTest.php deleted file mode 100644 index 227bc9535..000000000 --- a/lib/htmlpurifier/tests/HTMLPurifier/AttrCollectionsTest.php +++ /dev/null @@ -1,134 +0,0 @@ -<?php - -Mock::generatePartial( - 'HTMLPurifier_AttrCollections', - 'HTMLPurifier_AttrCollections_TestForConstruct', - array('performInclusions', 'expandIdentifiers') -); - -class HTMLPurifier_AttrCollectionsTest extends HTMLPurifier_Harness -{ - - function testConstruction() { - - generate_mock_once('HTMLPurifier_AttrTypes'); - - $collections = new HTMLPurifier_AttrCollections_TestForConstruct(); - - $types = new HTMLPurifier_AttrTypesMock(); - - $modules = array(); - - $modules['Module1'] = new HTMLPurifier_HTMLModule(); - $modules['Module1']->attr_collections = array( - 'Core' => array( - 0 => array('Soup', 'Undefined'), - 'attribute' => 'Type', - 'attribute-2' => 'Type2', - ), - 'Soup' => array( - 'attribute-3' => 'Type3-old' // overwritten - ) - ); - - $modules['Module2'] = new HTMLPurifier_HTMLModule(); - $modules['Module2']->attr_collections = array( - 'Core' => array( - 0 => array('Brocolli') - ), - 'Soup' => array( - 'attribute-3' => 'Type3' - ), - 'Brocolli' => array() - ); - - $collections->__construct($types, $modules); - // this is without identifier expansion or inclusions - $this->assertIdentical( - $collections->info, - array( - 'Core' => array( - 0 => array('Soup', 'Undefined', 'Brocolli'), - 'attribute' => 'Type', - 'attribute-2' => 'Type2' - ), - 'Soup' => array( - 'attribute-3' => 'Type3' - ), - 'Brocolli' => array() - ) - ); - - } - - function test_performInclusions() { - - generate_mock_once('HTMLPurifier_AttrTypes'); - - $types = new HTMLPurifier_AttrTypesMock(); - $collections = new HTMLPurifier_AttrCollections($types, array()); - $collections->info = array( - 'Core' => array(0 => array('Inclusion', 'Undefined'), 'attr-original' => 'Type'), - 'Inclusion' => array(0 => array('SubInclusion'), 'attr' => 'Type'), - 'SubInclusion' => array('attr2' => 'Type') - ); - - $collections->performInclusions($collections->info['Core']); - $this->assertIdentical( - $collections->info['Core'], - array( - 'attr-original' => 'Type', - 'attr' => 'Type', - 'attr2' => 'Type' - ) - ); - - // test recursive - $collections->info = array( - 'One' => array(0 => array('Two'), 'one' => 'Type'), - 'Two' => array(0 => array('One'), 'two' => 'Type') - ); - $collections->performInclusions($collections->info['One']); - $this->assertIdentical( - $collections->info['One'], - array( - 'one' => 'Type', - 'two' => 'Type' - ) - ); - - } - - function test_expandIdentifiers() { - - generate_mock_once('HTMLPurifier_AttrTypes'); - - $types = new HTMLPurifier_AttrTypesMock(); - $collections = new HTMLPurifier_AttrCollections($types, array()); - - $attr = array( - 'attr1' => 'Color', - 'attr2*' => 'URI' - ); - $c_object = new HTMLPurifier_AttrDef_HTML_Color(); - $u_object = new HTMLPurifier_AttrDef_URI(); - - $types->setReturnValue('get', $c_object, array('Color')); - $types->setReturnValue('get', $u_object, array('URI')); - - $collections->expandIdentifiers($attr, $types); - - $u_object->required = true; - $this->assertIdentical( - $attr, - array( - 'attr1' => $c_object, - 'attr2' => $u_object - ) - ); - - } - -} - -// vim: et sw=4 sts=4 |