filter out invalid language values
This commit is contained in:
parent
9455c0b233
commit
ed97568b8a
@ -30,11 +30,6 @@ class IntlCallbackChoiceLoader extends CallbackChoiceLoader
|
||||
return array();
|
||||
}
|
||||
|
||||
// If no callable is set, values are the same as choices
|
||||
if (null === $value) {
|
||||
return $values;
|
||||
}
|
||||
|
||||
return $this->loadChoiceList($value)->getChoicesForValues($values);
|
||||
}
|
||||
|
||||
|
@ -84,6 +84,11 @@ class IntlCallbackChoiceLoaderTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function testLoadChoicesForValuesDropsNonExistentChoices()
|
||||
{
|
||||
$this->assertSame(array(), self::$loader->loadChoicesForValues(array('foo')));
|
||||
}
|
||||
|
||||
public function testLoadValuesForChoicesLoadsChoiceListOnFirstCall()
|
||||
{
|
||||
$this->assertSame(
|
||||
|
Reference in New Issue
Block a user