1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-10-16 22:46:06 +02:00

- Added Composite and Core strategies.

- Added generate_mock() function for testing
- Factored out inputs/output tests to StrategyAbstractTest

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@124 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-07-29 17:38:28 +00:00
parent 39836fe278
commit 9b7ad89ab5
9 changed files with 171 additions and 23 deletions

View File

@@ -25,6 +25,16 @@ class HTMLPurifier_StrategyAbstractTest extends UnitTestCase
$this->gen = new HTMLPurifier_Generator();
}
function assertStrategyWorks($strategy, $inputs, $expect) {
foreach ($inputs as $i => $input) {
$tokens = $this->lex->tokenizeHTML($input);
$result_tokens = $strategy->execute($tokens);
$result = $this->gen->generateFromTokens($result_tokens);
$this->assertEqual($expect[$i], $result, "Test $i: %s");
paintIf($result, $result != $expect[$i]);
}
}
}
?>