Exemple #1
0
 public function checkMarkup($html)
 {
     $this->assertFalse(empty($html));
     $this->assertContains('<form', $html);
     $this->assertRegexp('/<form[^>]+action="' . $this->form->getAction() . '"/', $html);
     $this->assertRegexp('/<form[^>]+method="' . $this->form->getMethod() . '"/i', $html);
     $this->assertRegexp('#<form[^>]+enctype="application/x-www-form-urlencoded"#', $html);
     $this->assertContains('</form>', $html);
 }
 public function testCanSetObjectStateByPassingConfigObjectToConstructor()
 {
     $config = new Zend_Config($this->getOptions());
     $form = new Zend_Form($config);
     $this->assertEquals('foo', $form->getName());
     $this->assertEquals('someform', $form->getAttrib('class'));
     $this->assertEquals('/foo/bar', $form->getAction());
     $this->assertEquals('put', $form->getMethod());
 }
 /**
  * Return an array of form elements.
  *
  * @param Zend_Form $form
  * @return array
  */
 public function getFormAsArray(Zend_Form $form)
 {
     $array = array();
     $array['action'] = $form->getAction();
     $array['method'] = $form->getMethod();
     foreach ($form->getElements() as $element) {
         $element->removeDecorator('HtmlTag');
         $element->removeDecorator('Label');
         $element->removeDecorator('DtDdWrapper');
         $array[$element->getName()] = $element;
     }
     return $array;
 }