Skip to content

Commit 6995262

Browse files
committed
filter out invalid language values
1 parent a8fad03 commit 6995262

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ChoiceList/Loader/IntlCallbackChoiceLoader.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ public function loadChoicesForValues(array $values, $value = null)
3030
return array();
3131
}
3232

33-
// If no callable is set, values are the same as choices
34-
if (null === $value) {
35-
return $values;
36-
}
37-
3833
return $this->loadChoiceList($value)->getChoicesForValues($values);
3934
}
4035

Tests/ChoiceList/Loader/IntlCallbackChoiceLoaderTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ public function testLoadChoicesForValuesLoadsChoiceListOnFirstCall()
8484
);
8585
}
8686

87+
public function testLoadChoicesForValuesDropsNonExistentChoices()
88+
{
89+
$this->assertSame(array(), self::$loader->loadChoicesForValues(array('foo')));
90+
}
91+
8792
public function testLoadValuesForChoicesLoadsChoiceListOnFirstCall()
8893
{
8994
$this->assertSame(

0 commit comments

Comments
 (0)