mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 01:04:09 +02:00
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\Web\Request;
|
||||||
use Icinga\Test\BaseTestCase;
|
use Icinga\Test\BaseTestCase;
|
||||||
|
|
||||||
|
class PostRequest extends Request
|
||||||
|
{
|
||||||
|
public function getMethod()
|
||||||
|
{
|
||||||
|
return 'POST';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class SuccessfulForm extends Form
|
class SuccessfulForm extends Form
|
||||||
{
|
{
|
||||||
public function onSuccess()
|
public function onSuccess()
|
||||||
@ -58,6 +66,7 @@ class FormTest extends BaseTestCase
|
|||||||
$form->setTokenDisabled();
|
$form->setTokenDisabled();
|
||||||
$form->setSubmitLabel('test');
|
$form->setSubmitLabel('test');
|
||||||
$form->populate(array('btn_submit' => true));
|
$form->populate(array('btn_submit' => true));
|
||||||
|
$form->setRequest(new PostRequest());
|
||||||
|
|
||||||
$this->assertTrue(
|
$this->assertTrue(
|
||||||
$form->isSubmitted(),
|
$form->isSubmitted(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user