You are here

function BlockAccessTestCase::assertOption in Block Access 7

Helper - asserts that a select option in the current page exists

4 calls to BlockAccessTestCase::assertOption()
BlockAccessDisableTestCase::testUIGranted in tests/op_basic_disable.test
Test UI allows $user1 to do operation
BlockAccessEnableTestCase::testUIGranted in tests/op_basic_enable.test
Test UI allows $user1 to do operation
BlockAccessMoveTestCase::testUIGranted in tests/op_basic_move.test
Test UI allows $user1 to do operation
BlockAccessRegionSpecificTestCase::testCannotAccessRegion in tests/op_region.test
Test we can block $user1 access to a region

File

tests/common.test, line 150
Tests for block_access - common methods

Class

BlockAccessTestCase
Tests for block_access - common methods

Code

function assertOption($name, $option, $msg = '') {
  $elements = $this
    ->xpath('//select[@name=:name]//option[@value=:option]', array(
    ':name' => $name,
    ':option' => $option,
  ));
  $msg = $msg ? $msg : t('Option %option for field %name exists', array(
    '%option' => $option,
    '%name' => $name,
  ));
  return $this
    ->assertTrue(isset($elements[0]), $msg);
}