mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding test case to prove it is possible to escape error messages using form::input options parameter, closes #2920 as invalid
Signed-off-by: Mark Story <mark@mark-story.com>
This commit is contained in:
parent
e6c58e8030
commit
4752fc04da
1 changed files with 10 additions and 0 deletions
|
@ -5579,5 +5579,15 @@ class FormHelperTest extends CakeTestCase {
|
|||
$result = $this->Form->error('2.city');
|
||||
$this->assertTags($result, array('div' => array('class' => 'error-message'), 'Error in field city', '/div'));
|
||||
}
|
||||
|
||||
function testInputErrorEscape() {
|
||||
$this->Form->create('ValidateProfile');
|
||||
$this->Form->validationErrors['ValidateProfile']['city'] = 'required<br>';
|
||||
$result = $this->Form->input('city',array('error' => array('escape' => true)));
|
||||
$this->assertPattern('/required<br>/', $result);
|
||||
|
||||
$result = $this->Form->input('city',array('error' => array('escape' => false)));
|
||||
$this->assertPattern('/required<br>/', $result);
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in a new issue