mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-03 04:37:39 +02:00
[1.4.0] Support for configuration directive aliases added.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@668 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -199,6 +199,24 @@ class HTMLPurifier_ConfigTest extends UnitTestCase
|
||||
|
||||
}
|
||||
|
||||
function testAliases() {
|
||||
|
||||
HTMLPurifier_ConfigSchema::defineNamespace('Home', 'Sweet home.');
|
||||
HTMLPurifier_ConfigSchema::define('Home', 'Rug', 3, 'int', 'ID.');
|
||||
HTMLPurifier_ConfigSchema::defineAlias('Home', 'Carpet', 'Home', 'Rug');
|
||||
|
||||
$config = HTMLPurifier_Config::createDefault();
|
||||
|
||||
$this->assertEqual($config->get('Home', 'Rug'), 3);
|
||||
|
||||
$this->expectError('Cannot get value from aliased directive, use real name');
|
||||
$config->get('Home', 'Carpet');
|
||||
|
||||
$config->set('Home', 'Carpet', 999);
|
||||
$this->assertEqual($config->get('Home', 'Rug'), 999);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user