You are here

public function WebformLocationPlaces::getTestValues in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/WebformLocationPlaces.php \Drupal\webform\Plugin\WebformElement\WebformLocationPlaces::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 WebformCompositeBase::getTestValues

File

src/Plugin/WebformElement/WebformLocationPlaces.php, line 83

Class

WebformLocationPlaces
Provides an 'location' element using Algolia Places.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function getTestValues(array $element, WebformInterface $webform, array $options = []) {
  return [
    [
      'value' => '1600 Pennsylvania Avenue, Washington, District of Columbia, United States of America',
      'lat' => '38.8635',
      'lng' => '-76.946',
      'name' => '1600 Pennsylvania Avenue',
      'city' => 'Washington',
      'country' => 'United States of America',
      'country_code' => 'us',
      'administrative' => 'District of Columbia',
      'county' => 'Prince George\'s County',
      'suburb' => '',
      'postcode' => '20020',
    ],
  ];
}