mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
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:
parent
8707c6861a
commit
9d950c7698
2 changed files with 21 additions and 1 deletions
|
@ -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') {
|
||||
|
|
|
@ -1146,6 +1146,26 @@ class FormHelperTest extends CakeTestCase {
|
|||
'/div'
|
||||
);
|
||||
$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(
|
||||
|
|
Loading…
Reference in a new issue