mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-04 21:28:06 +02:00
Outfit a bunch of other classes so they can accept a configuration object. Put in basic scaffolding for extractBody() functionality.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@257 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -19,7 +19,6 @@ class HTMLPurifier_ChildDefTest extends UnitTestCase
|
||||
|
||||
function assertSeries($inputs, $expect, $config, $context = array()) {
|
||||
foreach ($inputs as $i => $input) {
|
||||
$tokens = $this->lex->tokenizeHTML($input);
|
||||
|
||||
if (!isset($context[$i])) {
|
||||
$context[$i] = null;
|
||||
@@ -28,12 +27,13 @@ class HTMLPurifier_ChildDefTest extends UnitTestCase
|
||||
$config[$i] = HTMLPurifier_Config::createDefault();
|
||||
}
|
||||
|
||||
$tokens = $this->lex->tokenizeHTML($input, $config[$i]);
|
||||
$result = $this->def->validateChildren($tokens, $config[$i], $context[$i]);
|
||||
|
||||
if (is_bool($expect[$i])) {
|
||||
$this->assertIdentical($expect[$i], $result, "Test $i: %s");
|
||||
} else {
|
||||
$result_html = $this->gen->generateFromTokens($result);
|
||||
$result_html = $this->gen->generateFromTokens($result, $config[$i]);
|
||||
$this->assertIdentical($expect[$i], $result_html, "Test $i: %s");
|
||||
paintIf($result_html, $result_html != $expect[$i]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user