[Form] add test for ArrayChoiceList handling null
This commit is contained in:
parent
d3c55cb3f1
commit
00e38198b7
@ -209,6 +209,13 @@ abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertSame(array(), $this->list->getValuesForChoices(array()));
|
$this->assertSame(array(), $this->list->getValuesForChoices(array()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testGetChoicesForValuesWithNull()
|
||||||
|
{
|
||||||
|
$values = $this->list->getValuesForChoices(array(null));
|
||||||
|
|
||||||
|
$this->assertNotEmpty($this->list->getChoicesForValues($values));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Symfony\Component\Form\ChoiceList\ChoiceListInterface
|
* @return \Symfony\Component\Form\ChoiceList\ChoiceListInterface
|
||||||
*/
|
*/
|
||||||
|
@ -22,9 +22,9 @@ class ArrayChoiceListTest extends AbstractChoiceListTest
|
|||||||
|
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
|
||||||
|
|
||||||
$this->object = new \stdClass();
|
$this->object = new \stdClass();
|
||||||
|
|
||||||
|
parent::setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function createChoiceList()
|
protected function createChoiceList()
|
||||||
@ -34,12 +34,12 @@ class ArrayChoiceListTest extends AbstractChoiceListTest
|
|||||||
|
|
||||||
protected function getChoices()
|
protected function getChoices()
|
||||||
{
|
{
|
||||||
return array(0, 1, '1', 'a', false, true, $this->object);
|
return array(0, 1, '1', 'a', false, true, $this->object, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getValues()
|
protected function getValues()
|
||||||
{
|
{
|
||||||
return array('0', '1', '2', '3', '4', '5', '6');
|
return array('0', '1', '2', '3', '4', '5', '6', '7');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user