public function testFormWithDashes() { $form = new Garp_Form(); $form->setAction('/my/action/')->setMethod('post'); $form->addElement('email', 'e-mail', array('label' => 'Your email address', 'required' => true)); $form->addElement('password', 'pass-word', array('label' => 'the label', 'required' => true)); $form->addElement('submit', 'Register'); $this->assertTrue($form->isValid(array('e-mail' => '*****@*****.**', 'pass-word' => '123456'))); }
/** * Add index to name attribute for better organisation of POST data. * @param string $type * @param string $name * @param array|Zend_Config $options * @return Zend_Form_Element */ public function createElement($type, $name, $options = null) { $element = parent::createElement($type, $name, $options); return $element; }