protected function EntityReferenceAdminTest::getAllOptionsList

Extract all the options of a select element.

1 call to EntityReferenceAdminTest::getAllOptionsList()
EntityReferenceAdminTest::assertFieldSelectOptions in drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAdminTest.php

File

drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAdminTest.php, line 55
Contains \Drupal\entity_reference\Tests\EntityReferenceAdminTest.

Class

EntityReferenceAdminTest
Tests the Entity Reference Admin UI.

Namespace

Drupal\entity_reference\Tests

Code

protected function getAllOptionsList($element) {
  $options = array();

  // Add all options items.
  foreach ($element->option as $option) {
    $options[] = (string) $option['value'];
  }

  // TODO: support optgroup.
  return $options;
}