Esempio n. 1
0
 public function testCanFindAllElements()
 {
     $form = new C3op_Form_ProjectCreate();
     $this->assertEquals('Zend_Form_Element_Text', get_class($form->getElement('title')));
     $this->assertEquals('Zend_Form_Element_Text', get_class($form->getElement('dateBegin')));
     $this->assertEquals('Zend_Form_Element_Text', get_class($form->getElement('date_finish')));
     $this->assertEquals('Zend_Form_Element_Text', get_class($form->getElement('value')));
     $this->assertEquals('Zend_Form_Element_Text', get_class($form->getElement('overhead')));
     $this->assertEquals('Zend_Form_Element_Text', get_class($form->getElement('management_fee')));
     $this->assertEquals('Zend_Form_Element_Textarea', get_class($form->getElement('object')));
     $this->assertEquals('Zend_Form_Element_Textarea', get_class($form->getElement('summary')));
     $this->assertEquals('Zend_Form_Element_Textarea', get_class($form->getElement('observation')));
     $this->assertEquals('Zend_Form_Element_Submit', get_class($form->getElement('submit')));
 }
Esempio n. 2
0
 private function setDateValueToFormField(C3op_Form_ProjectCreate $form, $fieldName, $value)
 {
     $field = $form->getElement($fieldName);
     if ($value != '0000-00-00') {
         $field->setValue($this->formatDataToShow($value));
     } else {
         $field->setValue("");
     }
 }