Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f620ae4b9c | ||
|
|
2b67d708ce | ||
|
|
bdc56f0239 | ||
|
|
6b68b0856c | ||
|
|
466aabedbd | ||
|
|
ef11b7dd2f | ||
|
|
f8cd022c4f | ||
|
|
bca8b11d67 | ||
|
|
db665c9f0f |
No files matched your search
@@ -3,6 +3,7 @@ language: php
|
||||
php:
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
- hhvm
|
||||
|
||||
sudo: false
|
||||
|
||||
+1
-1
@@ -694,7 +694,7 @@ class FormBuilder
|
||||
protected function getSelectedValue($value, $selected)
|
||||
{
|
||||
if (is_array($selected)) {
|
||||
return in_array($value, $selected) ? 'selected' : null;
|
||||
return in_array($value, $selected, true) ? 'selected' : null;
|
||||
}
|
||||
|
||||
return ((string) $value == (string) $selected) ? 'selected' : null;
|
||||
|
||||
@@ -267,6 +267,27 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase
|
||||
['name' => 'select-name']
|
||||
);
|
||||
$this->assertEquals($select, '<select name="select-name" id="select-name-id"></select>');
|
||||
|
||||
$select = $this->formBuilder->select(
|
||||
'size',
|
||||
[
|
||||
'Large sizes' => [
|
||||
'L' => 'Large',
|
||||
'XL' => 'Extra Large',
|
||||
],
|
||||
'S' => 'Small',
|
||||
],
|
||||
null,
|
||||
[
|
||||
'class' => 'class-name',
|
||||
'id' => 'select-id',
|
||||
]
|
||||
);
|
||||
|
||||
$this->assertEquals(
|
||||
$select,
|
||||
'<select class="class-name" id="select-id" name="size"><optgroup label="Large sizes"><option value="L">Large</option><option value="XL">Extra Large</option></optgroup><option value="S">Small</option></select>'
|
||||
);
|
||||
}
|
||||
|
||||
public function testFormSelectRepopulation()
|
||||
@@ -468,6 +489,17 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('<input src="'.$url.'" type="image">', $image);
|
||||
}
|
||||
|
||||
public function testFormColor()
|
||||
{
|
||||
$form1 = $this->formBuilder->color('foo');
|
||||
$form2 = $this->formBuilder->color('foo', '#ff0000');
|
||||
$form3 = $this->formBuilder->color('foo', null, ['class' => 'span2']);
|
||||
|
||||
$this->assertEquals('<input name="foo" type="color">', $form1);
|
||||
$this->assertEquals('<input name="foo" type="color" value="#ff0000">', $form2);
|
||||
$this->assertEquals('<input class="span2" name="foo" type="color">', $form3);
|
||||
}
|
||||
|
||||
protected function setModel(array $data, $object = true)
|
||||
{
|
||||
if ($object) {
|
||||
|
||||
Reference in new issue
Block a user