You are here

protected function og_menu_singleMenuItemNodeCreateTest::assertOption in OG Menu Single 7

Asserts that a select option in the current page does not exist.

1 call to og_menu_singleMenuItemNodeCreateTest::assertOption()
og_menu_singleMenuItemNodeCreateTest::testMenuLinkCreated in tests/og_menu_singleBase.test
Test skipping OgBehaviorHandler.

File

tests/og_menu_singleBase.test, line 145
Provides a base unit test class.

Class

og_menu_singleMenuItemNodeCreateTest

Code

protected function assertOption($id, $option, $message = '', $title = NULL) {
  $options = $this
    ->xpath('//select[@id=:id]//option[@value=:option]', array(
    ':id' => $id,
    ':option' => $option,
  ));
  $return = $this
    ->assertTrue(!empty($options[0]), $message ? $message : t('Option @option for field @id does exist.', array(
    '@option' => $option,
    '@id' => $id,
  )), t('Browser'));
  if ($return && $title) {
    $return = $return && $this
      ->assertTrue((string) $options[0][0] === $title, t('Option @option for field @id has the title !title.', array(
      '@option' => $option,
      '@id' => $id,
      '!title' => $title,
    )), t('Browser'));
  }
  return $return;
}