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:
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user