mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-05 05:37:49 +02:00
[1.7.0] Refactor HTMLDefinition and CSSDefinition to have a common Definition parent, rename setup() to doSetup() and make setup() call the template method after setting the setup variable. Test for references in ConfigTest.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1091 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -228,19 +228,23 @@ class HTMLPurifier_ConfigTest extends UnitTestCase
|
||||
$this->old_copy = HTMLPurifier_ConfigSchema::instance($this->old_copy);
|
||||
|
||||
$config = HTMLPurifier_Config::createDefault();
|
||||
$config->set('HTML', 'Doctype', 'XHTML 1.0 Strict');
|
||||
$config->autoFinalize = false;
|
||||
|
||||
$def = $config->getCSSDefinition();
|
||||
$this->assertIsA($def, 'HTMLPurifier_CSSDefinition');
|
||||
|
||||
$def = $config->getHTMLDefinition();
|
||||
$def2 = $config->getHTMLDefinition();
|
||||
$def =& $config->getHTMLDefinition();
|
||||
$def2 =& $config->getHTMLDefinition();
|
||||
$this->assertIsA($def, 'HTMLPurifier_HTMLDefinition');
|
||||
$this->assertIdentical($def, $def2);
|
||||
$this->assertReference($def, $def2);
|
||||
$this->assertTrue($def->setup);
|
||||
|
||||
// test re-calculation if HTML changes
|
||||
$config->set('HTML', 'Strict', true);
|
||||
unset($def, $def2);
|
||||
$def2 = $config->getHTMLDefinition(); // forcibly de-reference
|
||||
|
||||
$config->set('HTML', 'Doctype', 'HTML 4.01 Transitional');
|
||||
$def = $config->getHTMLDefinition();
|
||||
$this->assertIsA($def, 'HTMLPurifier_HTMLDefinition');
|
||||
$this->assertNotEqual($def, $def2);
|
||||
|
Reference in New Issue
Block a user