From b65a9972fbf4995f3f6857d0e9b26e3cf1e55649 Mon Sep 17 00:00:00 2001 From: grizlik Date: Sat, 4 Feb 2012 14:14:29 +0400 Subject: [PATCH] [Form] Added test ChoiceList::testGetChoicesForValuesCorrectOrderingOfResult for correct ordering check --- .../Form/Extension/Core/ChoiceList/ChoiceListTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/Symfony/Tests/Component/Form/Extension/Core/ChoiceList/ChoiceListTest.php b/tests/Symfony/Tests/Component/Form/Extension/Core/ChoiceList/ChoiceListTest.php index 7774b876c1..e63f609522 100644 --- a/tests/Symfony/Tests/Component/Form/Extension/Core/ChoiceList/ChoiceListTest.php +++ b/tests/Symfony/Tests/Component/Form/Extension/Core/ChoiceList/ChoiceListTest.php @@ -146,6 +146,12 @@ class ChoiceListTest extends \PHPUnit_Framework_TestCase $this->assertSame(array($this->obj2, $this->obj3), $this->list->getChoicesForValues($values)); } + public function testGetChoicesForValuesCorrectOrderingOfResult() + { + $values = array('2', '1'); + $this->assertSame(array($this->obj3, $this->obj2), $this->list->getChoicesForValues($values)); + } + public function testGetChoicesForValuesIgnoresNonExistingValues() { $values = array('1', '2', '5');