1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-06 22:26:31 +02:00

[1.7.0] Configuration object now finalizes itself after first read operation

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1075 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-05-20 18:06:51 +00:00
parent f1ec05afd0
commit 9728be4a52
8 changed files with 124 additions and 36 deletions

View File

@@ -9,9 +9,10 @@ class HTMLPurifier_URISchemeRegistryTest extends UnitTestCase
generate_mock_once('HTMLPurifier_URIScheme');
$config = HTMLPurifier_Config::createDefault();
$config->set('URI', 'AllowedSchemes', array('http' => true, 'telnet' => true));
$config->set('URI', 'OverrideAllowedSchemes', true);
$config = HTMLPurifier_Config::create(array(
'URI.AllowedSchemes' => 'http, telnet',
'URI.OverrideAllowedSchemes' => true
));
$context = new HTMLPurifier_Context();
$registry = new HTMLPurifier_URISchemeRegistry();
@@ -34,7 +35,10 @@ class HTMLPurifier_URISchemeRegistryTest extends UnitTestCase
$this->assertIdentical($registry->getScheme('foobar', $config, $context), $scheme_foobar);
// now, test when overriding is not allowed
$config->set('URI', 'OverrideAllowedSchemes', false);
$config = HTMLPurifier_Config::create(array(
'URI.AllowedSchemes' => 'http, telnet',
'URI.OverrideAllowedSchemes' => false
));
$this->assertNull($registry->getScheme('foobar', $config, $context));
// scheme not allowed and never registered