|
@ -14,6 +14,7 @@ require_once dirname(__FILE__) . '/../../view/PHPView.php'; |
|
|
require_once dirname(__FILE__) . '/../../view/helpers/ViewHelper.php'; |
|
|
require_once dirname(__FILE__) . '/../../view/helpers/ViewHelper.php'; |
|
|
require_once dirname(__FILE__) . '/../../form/FormViewHelper.php'; |
|
|
require_once dirname(__FILE__) . '/../../form/FormViewHelper.php'; |
|
|
require_once dirname(__FILE__) . '/../../session/Session.php'; |
|
|
require_once dirname(__FILE__) . '/../../session/Session.php'; |
|
|
|
|
|
require_once dirname(__FILE__) . '/../../exception/InitializationException.php'; |
|
|
|
|
|
|
|
|
class FormViewHelperTest extends PHPUnit_Framework_TestCase |
|
|
class FormViewHelperTest extends PHPUnit_Framework_TestCase |
|
|
{ |
|
|
{ |
|
@ -35,7 +36,7 @@ class FormViewHelperTest extends PHPUnit_Framework_TestCase |
|
|
public function testFormUnsetFormName() |
|
|
public function testFormUnsetFormName() |
|
|
{ |
|
|
{ |
|
|
$helper = new FormViewHelper($this->view); |
|
|
$helper = new FormViewHelper($this->view); |
|
|
$this->setExpectedException('Exception', 'Form name required for helper init'); |
|
|
|
|
|
|
|
|
$this->setExpectedException('InitializationException', 'Form name required for helper init'); |
|
|
// @TODO Refactor for form name is required param?
|
|
|
// @TODO Refactor for form name is required param?
|
|
|
$helper->form(); |
|
|
$helper->form(); |
|
|
} |
|
|
} |
|
@ -43,7 +44,7 @@ class FormViewHelperTest extends PHPUnit_Framework_TestCase |
|
|
public function testFormEmptyFormName() |
|
|
public function testFormEmptyFormName() |
|
|
{ |
|
|
{ |
|
|
$helper = new FormViewHelper($this->view); |
|
|
$helper = new FormViewHelper($this->view); |
|
|
$this->setExpectedException('Exception', 'Form name required for helper init'); |
|
|
|
|
|
|
|
|
$this->setExpectedException('InitializationException', 'Form name required for helper init'); |
|
|
$helper->form(''); |
|
|
$helper->form(''); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -80,14 +81,11 @@ class FormViewHelperTest extends PHPUnit_Framework_TestCase |
|
|
{ |
|
|
{ |
|
|
$helper = new FormViewHelper($this->view); |
|
|
$helper = new FormViewHelper($this->view); |
|
|
$helper->form($this->formname); |
|
|
$helper->form($this->formname); |
|
|
|
|
|
|
|
|
$value = $helper->message('field1'); |
|
|
$value = $helper->message('field1'); |
|
|
$this->assertSame('<span class="error">' . $this->view->escape('Can\'t serialize "value"') . '</span>', $value); |
|
|
$this->assertSame('<span class="error">' . $this->view->escape('Can\'t serialize "value"') . '</span>', $value); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function testMessageNotSet() |
|
|
public function testMessageNotSet() |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
$helper = new FormViewHelper($this->view); |
|
|
$helper = new FormViewHelper($this->view); |
|
|
$helper->form($this->formname); |
|
|
$helper->form($this->formname); |
|
|
|
|
|
|
|
|