protected function EntityReferenceAdminTest::assertFieldSelectOptions

File

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

Class

EntityReferenceAdminTest
Tests the Entity Reference Admin UI.

Namespace

Drupal\entity_reference\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,
    )));
  }
}