Fix failing form test
Form::isSubmitted() now also checks the request method.
This commit is contained in:
parent
b897813e71
commit
bb80347a36
|
@ -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(),
|
||||
|
|
Loading…
Reference in New Issue