function testPost() { $form = new SimpleForm(new SimpleFormTag(array('method' => 'post')), $this->page('C:\\Users\\Garen\\Documents\\CS580\\Recipes\\RecipesInLaravel\\public\\testtt.html')); $select = new SimpleSelectionTag(array('name' => 'a')); $select->addTag(new SimpleOptionTag(array('value' => 'aaa', 'selected' => ''))); $form->addWidget($select); $this->assertIdentical($form->submit(), new SimplePostEncoding(array('a' => 'aaa'))); }
function testSingleSelectFieldSubmittedWithPost() { $form = new SimpleForm(new SimpleFormTag(array('method' => 'post')), new SimpleUrl('htp://host')); $select = new SimpleSelectionTag(array('name' => 'a')); $select->addTag(new SimpleOptionTag(array('value' => 'aaa', 'selected' => ''))); $form->addWidget($select); $this->assertIdentical($form->submit(), new SimplePostEncoding(array('a' => 'aaa'))); }
public function testBlankOption() { $tag = new SimpleSelectionTag(array('name' => 'A')); $a = new SimpleOptionTag(array()); $tag->addTag($a); $b = new SimpleOptionTag(array()); $b->addContent('b'); $tag->addTag($b); $this->assertIdentical($tag->getValue(), ''); $tag->setValue('b'); $this->assertIdentical($tag->getValue(), 'b'); $tag->setValue(''); $this->assertIdentical($tag->getValue(), ''); }