You are here

function options_test_allowed_values_callback in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/options/tests/options_test/options_test.module \options_test_allowed_values_callback()

Implements callback_allowed_values_function().

See also

options_allowed_values().

2 string references to 'options_test_allowed_values_callback'
OptionsWidgetsTest::testSelectListMultiple in core/modules/options/src/Tests/OptionsWidgetsTest.php
Tests the 'options_select' widget (multiple select).
OptionsWidgetsTest::testSelectListSingle in core/modules/options/src/Tests/OptionsWidgetsTest.php
Tests the 'options_select' widget (single select).

File

core/modules/options/tests/options_test/options_test.module, line 16
Helper module for the List module tests.

Code

function options_test_allowed_values_callback(FieldStorageDefinitionInterface $definition, FieldableEntityInterface $entity = NULL) {
  $values = array(
    'Group 1' => array(
      0 => 'Zero',
    ),
    1 => 'One',
    'Group 2' => array(
      2 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>',
    ),
    'More <script>dangerous</script> markup' => array(
      3 => 'Three',
    ),
  );
  return $values;
}