assertIdentical($def->elements, array( 'foobar' => true ,'bang' => true ,'gizmo' => true )); } public function testPrepareArray() { $def = new HTMLPurifier_ChildDef_Required(array('href', 'src')); $this->assertIdentical($def->elements, array( 'href' => true ,'src' => true )); } public function setUp() { parent::setUp(); $this->obj = new HTMLPurifier_ChildDef_Required('dt | dd'); } public function testEmptyInput() { $this->assertResult('', false); } public function testRemoveIllegalTagsAndElements() { $this->assertResult( '
Term
Text in an illegal location'. '
Definition
Illegal tag', '
Term
Definition
'); $this->assertResult('How do you do!', false); } public function testIgnoreWhitespace() { // whitespace shouldn't trigger it $this->assertResult("\n
Definition
"); } public function testPreserveWhitespaceAfterRemoval() { $this->assertResult( '
Definition
', '
Definition
' ); } public function testDeleteNodeIfOnlyWhitespace() { $this->assertResult("\t ", false); } public function testPCDATAAllowed() { $this->obj = new HTMLPurifier_ChildDef_Required('#PCDATA | b'); $this->assertResult('Out Bold text', 'Out Bold text'); } public function testPCDATAAllowedJump() { $this->obj = new HTMLPurifier_ChildDef_Required('#PCDATA | b'); $this->assertResult('A foo', 'A foo'); } } // vim: et sw=4 sts=4