diff --git a/src/Symfony/Component/Form/ChoiceList/Loader/IntlCallbackChoiceLoader.php b/src/Symfony/Component/Form/ChoiceList/Loader/IntlCallbackChoiceLoader.php index f0140814fad6c..687c0197ae5ed 100644 --- a/src/Symfony/Component/Form/ChoiceList/Loader/IntlCallbackChoiceLoader.php +++ b/src/Symfony/Component/Form/ChoiceList/Loader/IntlCallbackChoiceLoader.php @@ -30,11 +30,6 @@ public function loadChoicesForValues(array $values, $value = null) return array(); } - // If no callable is set, values are the same as choices - if (null === $value) { - return $values; - } - return $this->loadChoiceList($value)->getChoicesForValues($values); } diff --git a/src/Symfony/Component/Form/Tests/ChoiceList/Loader/IntlCallbackChoiceLoaderTest.php b/src/Symfony/Component/Form/Tests/ChoiceList/Loader/IntlCallbackChoiceLoaderTest.php index 03e975dce1a24..12bfd74632f96 100644 --- a/src/Symfony/Component/Form/Tests/ChoiceList/Loader/IntlCallbackChoiceLoaderTest.php +++ b/src/Symfony/Component/Form/Tests/ChoiceList/Loader/IntlCallbackChoiceLoaderTest.php @@ -84,6 +84,11 @@ public function testLoadChoicesForValuesLoadsChoiceListOnFirstCall() ); } + public function testLoadChoicesForValuesDropsNonExistentChoices() + { + $this->assertSame(array(), self::$loader->loadChoicesForValues(array('foo'))); + } + public function testLoadValuesForChoicesLoadsChoiceListOnFirstCall() { $this->assertSame(