Пример #1
0
 public function __toString()
 {
     $html = '<div class="frm-wrapper">';
     $html .= '	' . $this->getFormatedCustomErrors();
     $html .= '	' . parent::__toString();
     $html .= '</div>';
     return $html;
 }
Пример #2
0
 public function testToStringRaisesErrorWhenExceptionCaught()
 {
     $this->form->setDecorators(array(array('decorator' => 'Callback', 'options' => array('callback' => array($this, 'raiseDecoratorException')))));
     $origErrorHandler = set_error_handler(array($this, 'handleDecoratorErrors'), E_USER_WARNING);
     $text = $this->form->__toString();
     restore_error_handler();
     $this->assertTrue(empty($text));
     $this->assertTrue(isset($this->error));
     $this->assertContains('Raising exception in decorator callback', $this->error);
 }