mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-23 08:51:53 +00:00
Modules are not passed by reference, so in PHP 4 we cannot guarantee same module that went in will be used.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@767 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
aff4957531
commit
4169846c57
@ -42,13 +42,18 @@ class HTMLPurifier_HTMLModuleManagerTest extends UnitTestCase
|
|||||||
$module2 = new HTMLPurifier_HTMLModule();
|
$module2 = new HTMLPurifier_HTMLModule();
|
||||||
$module2->name = 'Module2';
|
$module2->name = 'Module2';
|
||||||
|
|
||||||
|
// we need to grab the dynamically generated orders from
|
||||||
|
// the object since modules are not passed by reference
|
||||||
|
|
||||||
$this->manager->addModule($module);
|
$this->manager->addModule($module);
|
||||||
$this->assertEqual($module, $this->manager->modules['Module']);
|
|
||||||
$module_order = $this->manager->modules['Module']->order;
|
$module_order = $this->manager->modules['Module']->order;
|
||||||
|
$module->order = $module_order;
|
||||||
|
$this->assertEqual($module, $this->manager->modules['Module']);
|
||||||
|
|
||||||
$this->manager->addModule($module2);
|
$this->manager->addModule($module2);
|
||||||
$this->assertEqual($module2, $this->manager->modules['Module2']);
|
|
||||||
$module2_order = $this->manager->modules['Module2']->order;
|
$module2_order = $this->manager->modules['Module2']->order;
|
||||||
|
$module2->order = $module2_order;
|
||||||
|
$this->assertEqual($module2, $this->manager->modules['Module2']);
|
||||||
$this->assertEqual($module_order + 1, $module2_order);
|
$this->assertEqual($module_order + 1, $module2_order);
|
||||||
|
|
||||||
$this->assertEqual(
|
$this->assertEqual(
|
||||||
|
Loading…
Reference in New Issue
Block a user