Skip to content
Permalink
Browse files

Moving test method and adding doc block.

  • Loading branch information...
markstory committed Oct 31, 2009
1 parent 4752fc0 commit 55fc72c5337b709ea207377d833c0d22b4fa472c
Showing with 15 additions and 10 deletions.
  1. +15 −10 cake/tests/cases/libs/view/helpers/form.test.php
@@ -2372,6 +2372,21 @@ function testError() {
$this->assertTags($result, $expected);
}
/**
* test error options when using form->input();
*
* @return void
*/
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);
}
/**
* testPassword method
*
@@ -5579,15 +5594,5 @@ 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 55fc72c

Please sign in to comment.
You can’t perform that action at this time.