3 class HTMLPurifier_Strategy_FixNesting_ErrorsTest
extends HTMLPurifier_Strategy_ErrorsHarness
6 protected function getStrategy()
8 return new HTMLPurifier_Strategy_FixNesting();
11 public function testNodeRemoved()
13 $this->expectErrorCollection(E_ERROR
, 'Strategy_FixNesting: Node removed');
14 $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('ul', array(), 1));
15 $this->invoke('<ul></ul>');
18 public function testNodeExcluded()
20 $this->expectErrorCollection(E_ERROR
, 'Strategy_FixNesting: Node excluded');
21 $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('a', array(), 2));
22 $this->invoke("<a>\n<a></a></a>");
25 public function testNodeReorganized()
27 $this->expectErrorCollection(E_WARNING
, 'Strategy_FixNesting: Node reorganized');
28 $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('span', array(), 1));
29 $this->invoke("<span>Valid<div>Invalid</div></span>");
32 public function testNoNodeReorganizedForEmptyNode()
34 $this->expectNoErrorCollection();
35 $this->invoke("<span></span>");
38 public function testNodeContentsRemoved()
40 $this->expectErrorCollection(E_ERROR
, 'Strategy_FixNesting: Node contents removed');
41 $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('span', array(), 1));
42 $this->invoke("<span><div></div></span>");