diff --git a/library/HTMLPurifier/HTMLDefinition.php b/library/HTMLPurifier/HTMLDefinition.php index aaeb8bae..fe6bd141 100644 --- a/library/HTMLPurifier/HTMLDefinition.php +++ b/library/HTMLPurifier/HTMLDefinition.php @@ -330,7 +330,7 @@ class HTMLPurifier_HTMLDefinition extends HTMLPurifier_Definition if (isset($this->info_content_sets['Block'][$block_wrapper])) { $this->info_block_wrapper = $block_wrapper; } else { - trigger_error('Cannot use non-block element as block wrapper.', + trigger_error('Cannot use non-block element as block wrapper', E_USER_ERROR); } @@ -340,7 +340,7 @@ class HTMLPurifier_HTMLDefinition extends HTMLPurifier_Definition $this->info_parent = $parent; $this->info_parent_def = $def; } else { - trigger_error('Cannot use unrecognized element as parent.', + trigger_error('Cannot use unrecognized element as parent', E_USER_ERROR); $this->info_parent_def = $this->manager->getElement($this->info_parent, true); } diff --git a/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php b/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php index 788c7a36..256d3a34 100644 --- a/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php +++ b/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php @@ -74,6 +74,7 @@ extends HTMLPurifier_ChildDefHarness } function testError() { + $this->expectError('Cannot use non-block element as block wrapper'); $this->obj = new HTMLPurifier_ChildDef_StrictBlockquote('div | p'); $this->config->set('HTML', 'BlockWrapper', 'dav'); $this->assertResult('Needs wrap', '
Needs wrap
'); diff --git a/tests/HTMLPurifier/ChildDef/TableTest.php b/tests/HTMLPurifier/ChildDef/TableTest.php index 209e2a57..62247d23 100644 --- a/tests/HTMLPurifier/ChildDef/TableTest.php +++ b/tests/HTMLPurifier/ChildDef/TableTest.php @@ -3,6 +3,9 @@ require_once 'HTMLPurifier/ChildDefHarness.php'; require_once 'HTMLPurifier/ChildDef/Table.php'; +// we're using empty tags to compact the tests: under real circumstances +// there would be contents in them + class HTMLPurifier_ChildDef_TableTest extends HTMLPurifier_ChildDefHarness { @@ -11,40 +14,47 @@ class HTMLPurifier_ChildDef_TableTest extends HTMLPurifier_ChildDefHarness $this->obj = new HTMLPurifier_ChildDef_Table(); } - function test() { + function testEmptyInput() { $this->assertResult('', false); - - // we're using empty tags to compact the tests: under real circumstances - // there would be contents in them - + } + + function testSingleRow() { $this->assertResult('