You are here

protected function EntityReferenceAdminTestCase::getAllOptionsList in Entity reference 7

Extract all the options of a select element.

1 call to EntityReferenceAdminTestCase::getAllOptionsList()
EntityReferenceAdminTestCase::assertFieldSelectOptions in tests/entityreference.admin.test

File

tests/entityreference.admin.test, line 51
Contains EntityReferenceHandlersTestCase

Class

EntityReferenceAdminTestCase
Test for Entity Reference admin UI.

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;
}