0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-01-03 13:21:51 +00:00

Refine tests to include attribute checks and some other cases.

git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@40 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2006-04-16 16:57:51 +00:00
parent eefb08b6f9
commit ffbeaf66d1

View File

@ -73,6 +73,7 @@ class Test_PureHTMLDefinition extends UnitTestCase
,new MF_Text('bold') ,new MF_Text('bold')
,new MF_EndTag('b') ,new MF_EndTag('b')
,new MF_Text(' text') ,new MF_Text(' text')
,new MF_EmptyTag('br')
); );
$expect[1] = $inputs[1]; $expect[1] = $inputs[1];
@ -109,15 +110,17 @@ class Test_PureHTMLDefinition extends UnitTestCase
,new MF_Text('</b>') ,new MF_Text('</b>')
); );
$inputs[5] = array(new MF_StartTag('br')); $inputs[5] = array(new MF_StartTag('br', array('style' => 'clear:both;')));
$expect[5] = array(new MF_EmptyTag('br')); $expect[5] = array(new MF_EmptyTag('br', array('style' => 'clear:both;')));
$inputs[6] = array(new MF_EmptyTag('div')); $inputs[6] = array(new MF_EmptyTag('div', array('style' => 'clear:both;')));
$expect[6] = array( $expect[6] = array(
new MF_StartTag('div') new MF_StartTag('div', array('style' => 'clear:both;'))
,new MF_EndTag('div') ,new MF_EndTag('div')
); );
// demonstrates start tag precedence
foreach ($inputs as $i => $input) { foreach ($inputs as $i => $input) {
$result = $this->def->makeWellFormed($input); $result = $this->def->makeWellFormed($input);
$this->assertEqual($expect[$i], $result); $this->assertEqual($expect[$i], $result);