function testSingleFormSubmit() { $form_command = new FormInitCommand($this->form_id, LIMB_SINGLE_FORM); $toolkit =& Limb :: toolkit(); $dataspace =& $toolkit->switchDataspace($this->form_id); $request =& $toolkit->getRequest(); $request->set('submitted', 2); $request->set('request_field1', 2); $this->form_component->expectOnce('registerDataSource', array($dataspace)); $this->assertEqual($form_command->perform(), LIMB_STATUS_FORM_SUBMITTED); $this->assertEqual($dataspace->get('request_field1'), 2); $this->assertEqual($dataspace->get('submitted'), 2); }
function performInit() { include_once(LIMB_DIR . '/core/commands/FormInitCommand.class.php'); $command = new FormInitCommand($this->form_id, $this->is_multi); return $command->perform(); }