mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Fixes #5093 - True/False labels on <select> options.
This commit is contained in:
parent
fb98771b82
commit
faa2f8ad34
@ -3597,10 +3597,11 @@ var_dump($select_options);*/
|
||||
|
||||
$options = $this->format_options('option', '', $options);
|
||||
$options['selected'] = $selected; //comes as separate argument just for convenience
|
||||
|
||||
$ltitle = strtolower($option_title);
|
||||
$label = ($ltitle === 'true' || $ltitle === 'false') ? $option_title : defset($option_title, $option_title);
|
||||
|
||||
return "<option" . $this->attributes(['value' => $value]) . $this->get_attributes($options) . '>'
|
||||
. defset($option_title, $option_title) .
|
||||
. $label .
|
||||
'</option>';
|
||||
}
|
||||
|
||||
|
@ -779,6 +779,14 @@ class e_formTest extends \Codeception\Test\Unit
|
||||
|
||||
$this->assertEquals($expected, $actual);
|
||||
|
||||
$tests = ['true'=>'True', 'false'=>'False', 'legacy'=>'Legacy'];
|
||||
|
||||
foreach($tests as $k=>$v)
|
||||
{
|
||||
$expected = "<option value='$k'>$v</option>";
|
||||
$result = $this->_frm->option($v,$k);
|
||||
$this->assertSame($expected, $result);
|
||||
}
|
||||
}
|
||||
|
||||
public function testOption_multi()
|
||||
|
Loading…
x
Reference in New Issue
Block a user