You are here

protected function EntityReferenceAdminTestCase::assertFieldSelectOptions in Entity reference 7

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

File

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

Class

EntityReferenceAdminTestCase
Test for Entity Reference admin UI.

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