function testValuesAreAutoloaded()
 {
     // fake the submission of the form
     $_GET[SimpleForm_Form::SUBMIT_MARKER] = 'inputform';
     $_GET['firstname'] = 'Lachlan';
     $_GET['lastname'] = 'Donald';
     $form = new SimpleForm_Form();
     $form->parse($this->getFormHtml('inputform.html'));
     $this->assertEqual(array('firstname' => 'Lachlan', 'lastname' => 'Donald'), $form->getValues());
 }
Esempio n. 2
0
 function testLoadRequestDoesntOverwriteNumericKeyArrays()
 {
     $form = new SimpleForm_Form();
     $form->parse($this->getFormHtml('numberedtextarrayform.html'));
     $_SERVER['REQUEST_METHOD'] = 'POST';
     $_POST = array('textbox' => array(5 => 'test data'));
     $form->loadRequest();
     $array = $form->getValues();
     $this->assertEqual($array['textbox[5]'], 'test data');
 }