You are here

protected function LingotekProfileFormTest::assertFieldDisabled in Lingotek Translation 8

Asserts that a field in the current page is disabled.

Parameters

string $id: Id of field to assert.

string $message: Message to display.

Return value

bool TRUE on pass, FALSE on fail.

1 call to LingotekProfileFormTest::assertFieldDisabled()
LingotekProfileFormTest::testDefaultProfilesPresent in src/Tests/Form/LingotekProfileFormTest.php
Test that default profiles are present.

File

src/Tests/Form/LingotekProfileFormTest.php, line 407

Class

LingotekProfileFormTest
Tests the Lingotek profile form.

Namespace

Drupal\lingotek\Tests\Form

Code

protected function assertFieldDisabled($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 disabled.', array(
    '@id' => $id,
  )), t('Browser'));
}