You are here

protected function LingotekProfileFormTest::assertFieldDisabled in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::assertFieldDisabled()
  2. 4.0.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::assertFieldDisabled()
  3. 3.0.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::assertFieldDisabled()
  4. 3.1.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::assertFieldDisabled()
  5. 3.2.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::assertFieldDisabled()
  6. 3.3.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::assertFieldDisabled()
  7. 3.5.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::assertFieldDisabled()
  8. 3.6.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::assertFieldDisabled()
  9. 3.7.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::assertFieldDisabled()
  10. 3.8.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::assertFieldDisabled()

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 tests/src/Functional/Form/LingotekProfileFormTest.php
Test that default profiles are present.

File

tests/src/Functional/Form/LingotekProfileFormTest.php, line 700

Class

LingotekProfileFormTest
Tests the Lingotek profile form.

Namespace

Drupal\Tests\lingotek\Functional\Form

Code

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