You are here

protected function entityReferenceAdminTest::assertFieldSelectOptions in Entity reference 8

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

File

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

Class

entityReferenceAdminTest
Test for Entity Reference admin UI.

Namespace

Drupal\entityreference\Tests

Code

protected function assertFieldSelectOptions($name, $expected_options) {
  $xpath = $this
    ->buildXPathQuery('//select[@name=:name]', array(
    ':name' => $name,
  ));
  $fields = $this
    ->xpath($xpath);
  if ($fields) {
    $field = $fields[0];
    $options = $this
      ->getAllOptionsList($field);
    return $this
      ->assertIdentical($options, $expected_options);
  }
  else {
    return $this
      ->fail(t('Unable to find field @name', array(
      '@name' => $name,
    )));
  }
}