From 53911951707c5eff1dd41029f7f4139ea74fa90e Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Tue, 18 Jul 2006 23:17:41 +0000 Subject: [PATCH] Finalize fixNesting test suite. git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@55 48356398-32a2-884e-a903-53898d9a118a --- tests/PureHTMLDefinition.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/PureHTMLDefinition.php b/tests/PureHTMLDefinition.php index 28046fa3..76340d98 100644 --- a/tests/PureHTMLDefinition.php +++ b/tests/PureHTMLDefinition.php @@ -375,8 +375,9 @@ class Test_PureHTMLDefinition extends UnitTestCase $inputs = array(); $expect = array(); - // some legal nestings + // next id = 4 + // legal inline nesting $inputs[0] = array( new MF_StartTag('b'), new MF_Text('Bold text'), @@ -384,7 +385,7 @@ class Test_PureHTMLDefinition extends UnitTestCase ); $expect[0] = $inputs[0]; - // test acceptance of inline and block + // legal inline and block // as the parent element is considered FLOW $inputs[1] = array( new MF_StartTag('a', array('href' => 'http://www.example.com/')), @@ -396,7 +397,7 @@ class Test_PureHTMLDefinition extends UnitTestCase ); $expect[1] = $inputs[1]; - // test illegal block element -> text + // illegal block in inline, element -> text $inputs[2] = array( new MF_StartTag('b'), new MF_StartTag('div'), @@ -412,6 +413,18 @@ class Test_PureHTMLDefinition extends UnitTestCase new MF_EndTag('b'), ); + // illegal in + $inputs[3] = array( + new MF_StartTag('a'), + + new MF_EndTag('a') + ); + $expect[3] = array( + new MF_StartTag('a'), + + new MF_EndTag('a') + ); + foreach ($inputs as $i => $input) { $result = $this->def->fixNesting($input); $this->assertEqual($expect[$i], $result);