Skip to content

Commit

Permalink
[Form] add test for ArrayChoiceList handling null
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobion committed Feb 18, 2016
1 parent d3c55cb commit 00e3819
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Expand Up @@ -209,6 +209,13 @@ public function testGetValuesForChoicesEmpty()
$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
*/
Expand Down
Expand Up @@ -22,9 +22,9 @@ class ArrayChoiceListTest extends AbstractChoiceListTest

protected function setUp()
{
parent::setUp();

$this->object = new \stdClass();

parent::setUp();
}

protected function createChoiceList()
Expand All @@ -34,12 +34,12 @@ protected function createChoiceList()

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()
{
return array('0', '1', '2', '3', '4', '5', '6');
return array('0', '1', '2', '3', '4', '5', '6', '7');
}

/**
Expand Down

0 comments on commit 00e3819

Please sign in to comment.