mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-11 08:34:29 +02:00
[1.2.0]
- Factor out Config and Context object population through arrays - Bring dependent assertions together in IDTest.php - AttrDefHarness.php now resets context and configuration between tests - Add missing reference operator in AttrDef/ID.php git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@494 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -64,16 +64,13 @@ class HTMLPurifier_Harness extends UnitTestCase
|
||||
|
||||
// setup config object
|
||||
$config = HTMLPurifier_Config::createDefault();
|
||||
foreach ($config_array as $key => $value) {
|
||||
list($namespace, $directive) = explode('.', $key);
|
||||
$config->set($namespace, $directive, $value);
|
||||
}
|
||||
$config->loadArray($config_array);
|
||||
|
||||
// setup context object
|
||||
// setup context object. Note that we are operating on a copy of it!
|
||||
// We will extend the test harness to allow you to do post-tests
|
||||
// on the context object
|
||||
$context = new HTMLPurifier_Context();
|
||||
foreach ($context_array as $key => $value) {
|
||||
$context->register($key, $value);
|
||||
}
|
||||
$context->loadArray($context_array);
|
||||
|
||||
if ($this->to_tokens && is_string($input)) {
|
||||
$input = $this->lexer->tokenizeHTML($input, $config, $context);
|
||||
|
Reference in New Issue
Block a user