protected function SelectOrOtherNumberTestCase::getAvailableOptions in Select (or other) 7.3
2 calls to SelectOrOtherNumberTestCase::getAvailableOptions()
- SelectOrOtherNumberTestCase::testNoOtherSelected in tests/
select_or_other_number.test - Tests Select or Other without other selected.
- SelectOrOtherNumberTestCase::testOtherSelectedWithPreExistingKey in tests/
select_or_other_number.test
File
- tests/
select_or_other_number.test, line 111
Class
- SelectOrOtherNumberTestCase
- Tests the select or other text field based functionality
Code
protected function getAvailableOptions($instance_settings) {
$options = array();
$lines = explode("\r\n", $instance_settings['widget']['settings']['available_options']);
foreach ($lines as $line) {
$parts = explode('|', $line);
if (count($parts) > 1) {
$options[$parts[0]] = $parts[1];
}
}
return $options;
}