You are here

protected function LingotekProfileFormTest::assertFieldEnabled in Lingotek Translation 3.6.x

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

Asserts that a field in the current page is enabled.

Parameters

$id: Id of field to assert.

$message: Message to display.

Return value

bool TRUE on pass, FALSE on fail.

2 calls to LingotekProfileFormTest::assertFieldEnabled()
LingotekProfileFormTest::testAddingProfile in tests/src/Functional/Form/LingotekProfileFormTest.php
Test adding a profile are present.
LingotekProfileFormTest::testEnableIntelligenceOverride in tests/src/Functional/Form/LingotekProfileFormTest.php
Tests that we can enable intelligence metadata overrides.

File

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

Class

LingotekProfileFormTest
Tests the Lingotek profile form.

Namespace

Drupal\Tests\lingotek\Functional\Form

Code

protected function assertFieldEnabled($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 enabled.', [
    '@id' => $id,
  ]), t('Browser'));
}