Skip to content

Commit

Permalink
Fix failing form test
Browse files Browse the repository at this point in the history
Form::isSubmitted() now also checks the request method.
  • Loading branch information
lippserd committed Sep 7, 2015
1 parent b897813 commit bb80347
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/php/library/Icinga/Web/FormTest.php
Expand Up @@ -8,6 +8,14 @@
use Icinga\Web\Request;
use Icinga\Test\BaseTestCase;

class PostRequest extends Request
{
public function getMethod()
{
return 'POST';
}
}

class SuccessfulForm extends Form
{
public function onSuccess()
Expand Down Expand Up @@ -58,6 +66,7 @@ public function testWhetherIsSubmittedReturnsTrueWithASubmitLabelBeingSet()
$form->setTokenDisabled();
$form->setSubmitLabel('test');
$form->populate(array('btn_submit' => true));
$form->setRequest(new PostRequest());

$this->assertTrue(
$form->isSubmitted(),
Expand Down

0 comments on commit bb80347

Please sign in to comment.