mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-07 14:46:48 +02:00
[1.2.0]
- Partially finished migrating to new Context object (done in r485). - Created HTMLPurifier_Harness to assist with testing, ChildDefTest migrated to that framework. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@484 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -25,12 +25,13 @@ class HTMLPurifier_StrategyHarness extends UnitTestCase
|
||||
}
|
||||
|
||||
function assertStrategyWorks($strategy, $inputs, $expect, $config = array()) {
|
||||
$context = new HTMLPurifier_Context();
|
||||
foreach ($inputs as $i => $input) {
|
||||
$tokens = $this->lex->tokenizeHTML($input);
|
||||
if (!isset($config[$i])) {
|
||||
$config[$i] = HTMLPurifier_Config::createDefault();
|
||||
}
|
||||
$result_tokens = $strategy->execute($tokens, $config[$i]);
|
||||
$tokens = $this->lex->tokenizeHTML($input, $config[$i], $context);
|
||||
$result_tokens = $strategy->execute($tokens, $config[$i], $context);
|
||||
$result = $this->gen->generateFromTokens($result_tokens, $config[$i]);
|
||||
$this->assertEqual($expect[$i], $result, "Test $i: %s");
|
||||
paintIf($result, $result != $expect[$i]);
|
||||
|
Reference in New Issue
Block a user