public function testRenderWithEmptyForm() { $form = new \HtmlForm\Form(); $expected = '<form method="post" action="index.php?test=aha" id="hfc" ></form>'; $result = $form->render(); $this->assertEquals($expected, $result); }
public function testHoneypot() { $validator = new Validator(); // test pass $form = new \HtmlForm\Form(); $form->addHoneypot(); $result = $validator->validate($form); $this->assertFalse($validator->honeypotError); // test fail $result = $validator->honeypot("string"); $this->assertTrue($validator->honeypotError); }