From 7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 12 May 2012 17:57:41 -0700 Subject: some important stuff we'll need --- .../Strategy/FixNesting_ErrorsTest.php | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 lib/htmlpurifier/tests/HTMLPurifier/Strategy/FixNesting_ErrorsTest.php (limited to 'lib/htmlpurifier/tests/HTMLPurifier/Strategy/FixNesting_ErrorsTest.php') diff --git a/lib/htmlpurifier/tests/HTMLPurifier/Strategy/FixNesting_ErrorsTest.php b/lib/htmlpurifier/tests/HTMLPurifier/Strategy/FixNesting_ErrorsTest.php new file mode 100644 index 000000000..468480774 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/Strategy/FixNesting_ErrorsTest.php @@ -0,0 +1,41 @@ +expectErrorCollection(E_ERROR, 'Strategy_FixNesting: Node removed'); + $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('ul', array(), 1)); + $this->invoke(''); + } + + function testNodeExcluded() { + $this->expectErrorCollection(E_ERROR, 'Strategy_FixNesting: Node excluded'); + $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('a', array(), 2)); + $this->invoke("\n"); + } + + function testNodeReorganized() { + $this->expectErrorCollection(E_WARNING, 'Strategy_FixNesting: Node reorganized'); + $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('span', array(), 1)); + $this->invoke("Valid
Invalid
"); + } + + function testNoNodeReorganizedForEmptyNode() { + $this->expectNoErrorCollection(); + $this->invoke(""); + } + + function testNodeContentsRemoved() { + $this->expectErrorCollection(E_ERROR, 'Strategy_FixNesting: Node contents removed'); + $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('span', array(), 1)); + $this->invoke("
"); + } + +} + +// vim: et sw=4 sts=4 -- cgit v1.2.3