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:
José Lorenzo Rodríguez 2009-10-30 00:02:33 -04:30 committed by mark_story
parent e6c58e8030
commit 4752fc04da

View file

@ -5579,5 +5579,15 @@ class FormHelperTest extends CakeTestCase {
$result = $this->Form->error('2.city'); $result = $this->Form->error('2.city');
$this->assertTags($result, array('div' => array('class' => 'error-message'), 'Error in field city', '/div')); $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);
}
} }
?> ?>