Skip to content

Commit

Permalink
Disproving FormHelper::textarea always escapes value. Closes #6016.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8006 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
renan committed Jan 21, 2009
1 parent 9f83e96 commit b5d7f18
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions cake/tests/cases/libs/view/helpers/form.test.php
Expand Up @@ -614,7 +614,7 @@ function setUp() {
'minutesRegex' => 'preg:/(?:<option value="([\d]+)">0?\\1<\/option>[\r\n]*)*/',
'meridianRegex' => 'preg:/(?:<option value="(am|pm)">\\1<\/option>[\r\n]*)*/',
);

Configure::write('Security.salt', 'foo!');
}
/**
Expand Down Expand Up @@ -1558,7 +1558,7 @@ function testFormInput() {
$this->assertNoPattern('#<option value="12"[^>]*>12</option>#', $result[1]);
$this->assertNoPattern('#<option value="50"[^>]*>50</option>#', $result[1]);
$this->assertPattern('#<option value="15"[^>]*>15</option>#', $result[1]);

$result = $this->Form->input('prueba', array(
'type' => 'time', 'timeFormat'=> 24 , 'dateFormat'=>'DMY' , 'minYear' => 2008,
'maxYear' => date('Y') + 1 ,'interval' => 15
Expand All @@ -1568,7 +1568,7 @@ function testFormInput() {
$this->assertNoPattern('#<option value="50"[^>]*>50</option>#', $result[1]);
$this->assertPattern('#<option value="15"[^>]*>15</option>#', $result[1]);
$this->assertPattern('#<option value="30"[^>]*>30</option>#', $result[1]);

$result = $this->Form->input('prueba', array(
'type' => 'datetime', 'timeFormat'=> 24 , 'dateFormat'=>'DMY' , 'minYear' => 2008,
'maxYear' => date('Y') + 1 ,'interval' => 15
Expand Down Expand Up @@ -4181,6 +4181,15 @@ function testTextArea() {
'/textarea',
);
$this->assertTags($result, $expected);

$this->Form->data = array('Model' => array('field' => 'some <strong>test</strong> data with <a href="#">HTML</a> chars'));
$result = $this->Form->textarea('Model.field', array('escape' => false));
$expected = array(
'textarea' => array('name' => 'data[Model][field]', 'id' => 'ModelField'),
'some <strong>test</strong> data with <a href="#">HTML</a> chars',
'/textarea',
);
$this->assertTags($result, $expected);
}
/**
* testTextAreaWithStupidCharacters method
Expand Down

0 comments on commit b5d7f18

Please sign in to comment.