function testFormAttributes() { $tag = new SimpleFormTag(array('method' => 'GET', 'action' => 'here.php', 'id' => '33')); $form = new SimpleForm($tag, $this->page('http://host/a/index.html')); $this->assertEqual($form->getMethod(), 'get'); $this->assertIdentical($form->getId(), '33'); $this->assertNull($form->getValue(new SimpleByName('a'))); }
public function test_construct_with_params() { try { $form = new SimpleForm("POST", "http://mydomain.com/myurl"); $this->assertEquals("POST", $form->getMethod()); $this->assertEquals("http://mydomain.com/myurl", $form->getUrl()); } catch (WTForms\Exception $e) { $this->fail($e->getMessage()); } }