--- FormErrorsTest.php (24593) +++ FormErrorsTest.php (working copy) @@ -329,6 +329,39 @@ $this->assertTrue($this->decorator->getShowCustomFormErrors()); } + /** + * @group ZF-11225 + */ + public function testRenderingEscapesFormErrorsByDefault() + { + $this->setupForm(); + $this->form->addDecorator($this->decorator) + ->addError('form-badness'); + $html = $this->form->render(); + $this->assertContains('<strong>form-badness</strong>', $html); + } + + /** + * @group ZF-11225 + */ + public function testCanDisableEscapingFormErrors() + { + $this->setupForm(); + $this->form->addDecorator($this->decorator); + + // Set error message with html content + $this->form->addError('form-badness'); + + // Set element label with html content + $this->form->getElement('bar')->setLabel('Sub Bar: '); + + $this->form->getDecorator('FormErrors')->setEscape(false); + + $html = $this->form->render(); + $this->assertContains('
  • form-badness', $html); + $this->assertContains('
  • Sub Bar: ', $html); + } + public function markupOptionMethodsProvider() { return array(