filter out invalid language values

This commit is contained in:
Christian Flothmann 2018-12-07 15:34:22 +00:00
parent 9455c0b233
commit ed97568b8a
2 changed files with 5 additions and 5 deletions

View File

@ -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);
}

View File

@ -84,6 +84,11 @@ class IntlCallbackChoiceLoaderTest extends TestCase
);
}
public function testLoadChoicesForValuesDropsNonExistentChoices()
{
$this->assertSame(array(), self::$loader->loadChoicesForValues(array('foo')));
}
public function testLoadValuesForChoicesLoadsChoiceListOnFirstCall()
{
$this->assertSame(