Adding Optional Placeholder for Selects Re: #60

Signed-off-by: Adam Engebretson <adam@enge.me>
This commit is contained in:
Adam Engebretson committed 2015-07-22 14:05:21 -05:00
1 parent c93974c835
commit 9c4fea1f04
2 files changed
+1106 -1015

No files matched your search

+18
View File
@@ -314,6 +314,24 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase {
$this->assertEquals($select, '<select name="size[key]"><option value="L">Large</option><option value="M">Medium</option><option value="S" selected="selected">Small</option></select>');
}
public function testFormWithOptionalPlaceholder()
{
$select = $this->formBuilder->select(
'size',
['L' => 'Large', 'S' => 'Small'],
null,
['optional' => 'Select One...']
);
$this->assertEquals($select, '<select name="size"><option selected="selected">Select One...</option><option value="L">Large</option><option value="S">Small</option></select>');
$select = $this->formBuilder->select(
'size',
['L' => 'Large', 'S' => 'Small'],
'L',
['optional' => 'Select One...']
);
$this->assertEquals($select, '<select name="size"><option>Select One...</option><option value="L" selected="selected">Large</option><option value="S">Small</option></select>');
}
public function testFormSelectYear()
{