You are here

protected function entityReferenceAdminTest::getAllOptionsList in Entity reference 8

Extract all the options of a select element.

1 call to entityReferenceAdminTest::getAllOptionsList()
entityReferenceAdminTest::assertFieldSelectOptions in lib/Drupal/entityreference/Tests/entityReferenceAdminTest.php

File

lib/Drupal/entityreference/Tests/entityReferenceAdminTest.php, line 55
Contains Drupal\entityreference\Tests\entityReferenceAdminTest.

Class

entityReferenceAdminTest
Test for Entity Reference admin UI.

Namespace

Drupal\entityreference\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;
}