/** * @covers Application_Form_Confirmation::__construct * @covers Application_Form_Confirmation::init */ public function testConstructForm() { $form = new Application_Form_Confirmation('Opus_Licence'); $this->assertEquals('Opus_Licence', $form->getModelClass()); $this->assertEquals(3, count($form->getElements())); $this->assertNotNull($form->getElement('Id')); $this->assertNotNull($form->getElement('ConfirmYes')); $this->assertNotNull($form->getElement('ConfirmNo')); $this->assertNotNull($form->getLegend()); $this->assertEquals(3, count($form->getDecorators())); $this->assertNotNull($form->getDecorator('ViewScript')); $this->assertNotNull($form->getDecorator('Fieldset')); $this->assertNotNull($form->getDecorator('Form')); $this->assertEquals('headline', $form->getDecorator('Fieldset')->getOption('class')); }
/** * Erzeugt ein Bestätigunsformular für ein Model. * * Das Bestätigunsformular ohne Model wird für die Validierung verwendet. * * @param Opus_Model_AbstractDb $model * @return Application_Form_Confirmation */ public function getConfirmationForm($model = null) { $form = new Application_Form_Confirmation($this->getModelClass()); if (!$this->getVerifyModelIdIsNumeric()) { $form->getElement(Application_Form_Confirmation::ELEMENT_MODEL_ID)->removeValidator('int'); } if (!is_null($model)) { $form->setModel($model); } return $form; }