Fix failing form test

Form::isSubmitted() now also checks the request method.
This commit is contained in:
Eric Lippmann 2015-09-07 13:56:03 +02:00
parent b897813e71
commit bb80347a36
1 changed files with 9 additions and 0 deletions

View File

@ -8,6 +8,14 @@ use Icinga\Web\Form;
use Icinga\Web\Request;
use Icinga\Test\BaseTestCase;
class PostRequest extends Request
{
public function getMethod()
{
return 'POST';
}
}
class SuccessfulForm extends Form
{
public function onSuccess()
@ -58,6 +66,7 @@ class FormTest extends BaseTestCase
$form->setTokenDisabled();
$form->setSubmitLabel('test');
$form->populate(array('btn_submit' => true));
$form->setRequest(new PostRequest());
$this->assertTrue(
$form->isSubmitted(),