mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-12 00:54:48 +02:00
Finish implementing fixNesting(). Removed security-in-depth check for optimization reasons, since the info array will never cause such a condition.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@58 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -413,14 +413,29 @@ class Test_PureHTMLDefinition extends UnitTestCase
|
||||
new MF_EndTag('b'),
|
||||
);
|
||||
|
||||
// need test of empty set that's required, resulting in removal of node
|
||||
// test of empty set that's required, resulting in removal of node
|
||||
$inputs[3] = array(
|
||||
new MF_StartTag('ul'),
|
||||
new MF_EndTag('ul')
|
||||
);
|
||||
$expect[3] = array();
|
||||
|
||||
// need test of cascading removal (if possible)
|
||||
|
||||
// ! cover all child element conditions
|
||||
|
||||
// execute only one test at a time:
|
||||
$inputs = array( $inputs[0] );
|
||||
// test illegal text which gets removed
|
||||
$inputs[4] = array(
|
||||
new MF_StartTag('ul'),
|
||||
new MF_Text('Illegal Text'),
|
||||
new MF_StartTag('li'),
|
||||
new MF_Text('Legal item'),
|
||||
new MF_EndTag('li'),
|
||||
new MF_EndTag('ul')
|
||||
);
|
||||
$expect[4] = array(
|
||||
new MF_StartTag('ul'),
|
||||
new MF_StartTag('li'),
|
||||
new MF_Text('Legal item'),
|
||||
new MF_EndTag('li'),
|
||||
new MF_EndTag('ul')
|
||||
);
|
||||
|
||||
foreach ($inputs as $i => $input) {
|
||||
$result = $this->def->fixNesting($input);
|
||||
|
Reference in New Issue
Block a user