closes #4726, test cases added to show special characters in select options

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7189 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2008-06-14 21:48:57 +00:00
parent 8707c6861a
commit 9d950c7698
2 changed files with 21 additions and 1 deletions

View file

@ -657,7 +657,7 @@ class FormHelper extends AppHelper {
}
if ($label !== false) {
$labelAttributes = $this->domId($labelAttributes, 'for');
$labelAttributes = $this->domId(array(), 'for');
if (in_array($options['type'], array('date', 'datetime'))) {
$labelAttributes['for'] .= 'Month';
} else if ($options['type'] === 'time') {

View file

@ -1147,6 +1147,26 @@ class FormHelperTest extends CakeTestCase {
);
$this->assertTags($result, $expected);
$result = $this->Form->input('email', array('options' => array('è' => 'Firést', 'é' => 'Secoènd'), 'empty' => true));
$expected = array(
'div' => array('class' => 'input select'),
'label' => array('for' => 'email'),
'Email',
'/label',
array('select' => array('name' => 'data[email]', 'id' => 'email')),
array('option' => array('value' => '')),
'/option',
array('option' => array('value' => 'è')),
'Firést',
'/option',
array('option' => array('value' => 'é')),
'Secoènd',
'/option',
'/select',
'/div'
);
$this->assertTags($result, $expected);
$result = $this->Form->input('email', array('options' => array('First', 'Second'), 'empty' => true));
$expected = array(
'div' => array('class' => 'input select'),