예제 #1
0
 /**
  * @group ZF-5056
  */
 public function testRenderingWithValueAfterValidation()
 {
     // Set element options
     $this->element->setOptions(array('label' => 'Foo', 'value' => 'bar', 'decorators' => array('ViewHelper')));
     // Validate
     $this->element->isValid(null);
     $this->assertEquals(PHP_EOL . '<button name="foo" id="foo" type="button" value="bar">Foo</button>', $this->element->render($this->getView()));
 }
예제 #2
0
 /**
  * @group ZF-5056
  */
 public function testRenderingButtonAsTypeSubmit()
 {
     // Create element
     require_once 'Zend/Form/Element/Button.php';
     $element = new Zend_Form_Element_Button('foo');
     $element->setAttrib('type', 'submit');
     $element->setDecorators(array('ViewHelper'));
     // Test
     $this->assertEquals(PHP_EOL . '<button name="foo" id="foo" type="submit">foo</button>', $element->render($this->getView()));
 }