You are here

public function WebformOptionsCustom::getTestValues in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_options_custom/src/Plugin/WebformElement/WebformOptionsCustom.php \Drupal\webform_options_custom\Plugin\WebformElement\WebformOptionsCustom::getTestValues()

Get test values for an element.

Parameters

array $element: An element.

\Drupal\webform\WebformInterface $webform: A webform.

array $options: Options used to generate a test value.

Return value

mixed A test value for an element.

Overrides WebformElementBase::getTestValues

File

modules/webform_options_custom/src/Plugin/WebformElement/WebformOptionsCustom.php, line 200

Class

WebformOptionsCustom
Provides a custom options element.

Namespace

Drupal\webform_options_custom\Plugin\WebformElement

Code

public function getTestValues(array $element, WebformInterface $webform, array $options = []) {
  $this
    ->setOptions($element);
  return array_keys($element['#options']);
}