Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99342cc225 | ||
|
|
e8b6bb0ff9 | ||
|
|
b788835612 | ||
|
|
d24e18156f | ||
|
|
3dd594748c | ||
|
|
f620ae4b9c | ||
|
|
2b67d708ce | ||
|
|
bdc56f0239 | ||
|
|
6b68b0856c | ||
|
|
466aabedbd | ||
|
|
ef11b7dd2f | ||
|
|
f8cd022c4f | ||
|
|
bca8b11d67 | ||
|
|
db665c9f0f |
No files matched your search
+1
-1
@@ -3,7 +3,7 @@ language: php
|
||||
php:
|
||||
- 5.5
|
||||
- 5.6
|
||||
- hhvm
|
||||
- 7.0
|
||||
|
||||
sudo: false
|
||||
|
||||
|
||||
+1087
-1085
File diff suppressed because it is too large.
Load diff
+45
-13
@@ -13,20 +13,20 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase
|
||||
/**
|
||||
* Setup the test environment.
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->urlGenerator = new UrlGenerator(new RouteCollection(), Request::create('/foo', 'GET'));
|
||||
$this->htmlBuilder = new HtmlBuilder($this->urlGenerator);
|
||||
$this->formBuilder = new FormBuilder($this->htmlBuilder, $this->urlGenerator, 'abc');
|
||||
}
|
||||
public function setUp()
|
||||
{
|
||||
$this->urlGenerator = new UrlGenerator(new RouteCollection(), Request::create('/foo', 'GET'));
|
||||
$this->htmlBuilder = new HtmlBuilder($this->urlGenerator);
|
||||
$this->formBuilder = new FormBuilder($this->htmlBuilder, $this->urlGenerator, 'abc');
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy the test environment.
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
m::close();
|
||||
}
|
||||
/**
|
||||
* Destroy the test environment.
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
m::close();
|
||||
}
|
||||
|
||||
public function testOpeningForm()
|
||||
{
|
||||
@@ -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