public function testGetAll() { $this->form->add('name', 'text', array('label' => 'Name')); $this->form->add('category', 'select', array('choices' => array('category_one' => 'Category One', 'category_two' => 'Category Two'), 'label' => 'Category')); $this->form->add('url', 'textarea', array('label' => 'URL')); $expected_result = array('name' => array('name' => 'name', 'type' => 'text', 'options' => array('label' => 'Name')), 'category' => array('name' => 'category', 'type' => 'select', 'options' => array('choices' => array('category_one' => 'Category One', 'category_two' => 'Category Two'), 'label' => 'Category')), 'url' => array('name' => 'url', 'type' => 'textarea', 'options' => array('label' => 'URL'))); $this->assertEquals($expected_result, $this->form->getAll()); }
public function testFileFormEncoding() { $form_blueprint = new FormBlueprint(); $form_blueprint->add('file_upload', 'file'); $handler = new FormHandler($form_blueprint); $this->assertEquals('multipart/form-data', $handler->getEncoding()); }