You are here

protected function og_menu_singleMenuItemNodeCreateTest::assertNoOption in OG Menu Single 7

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

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

File

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

Class

og_menu_singleMenuItemNodeCreateTest

Code

protected function assertNoOption($id, $option, $message = '') {
  $selects = $this
    ->xpath('//select[@id=:id]', array(
    ':id' => $id,
  ));
  $options = $this
    ->xpath('//select[@id=:id]//option[@value=:option]', array(
    ':id' => $id,
    ':option' => $option,
  ));
  return $this
    ->assertTrue(isset($selects[0]) && empty($options[0]), $message ? $message : t('Option @option for field @id does not exist.', array(
    '@option' => $option,
    '@id' => $id,
  )), t('Browser'));
}