You are here

protected function ForumAccessBaseTestCase::assertFieldEnabled in Forum Access 7

Asserts that a field in the current page is enabled.

Parameters

$id: Id of field to assert.

$message: Message to display.

Return value

TRUE on pass, FALSE on fail.

1 call to ForumAccessBaseTestCase::assertFieldEnabled()
ForumAccess11InitialConfigurationTestCase::testInitialConfiguration in tests/forum_access.test

File

tests/forum_access_test_base.php, line 230
Base class with auxiliary functions for forum access module tests.

Class

ForumAccessBaseTestCase
Base test class for the Forum Access module.

Code

protected function assertFieldEnabled($id, $message = '') {
  $elements = $this
    ->xpath('//input[@id=:id]', array(
    ':id' => $id,
  ));
  return $this
    ->assertTrue(isset($elements[0]) && empty($elements[0]['disabled']), $message ? $message : t('Field @id is enabled.', array(
    '@id' => $id,
  )), t('Browser'));
}