Permalink
Browse files

Adding test case to prove it is possible to escape error messages usi…

…ng form::input options parameter, closes #2920 as invalid

Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information...
1 parent e6c58e8 commit 4752fc04da09ff121579a9abf65a9f88ee4236b9 @lorenzo lorenzo committed with markstory Oct 30, 2009
Showing with 10 additions and 0 deletions.
  1. +10 −0 cake/tests/cases/libs/view/helpers/form.test.php
View
10 cake/tests/cases/libs/view/helpers/form.test.php
@@ -5579,5 +5579,15 @@ function testMultiRecordFormValidationErrors() {
$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&lt;br&gt;/', $result);
+
+ $result = $this->Form->input('city',array('error' => array('escape' => false)));
+ $this->assertPattern('/required<br>/', $result);
+ }
}
?>

0 comments on commit 4752fc0

Please sign in to comment.