You are here

protected function LingotekChangeAccountDefaultsTest::assertTableValue in Lingotek Translation 3.7.x

Same name and namespace in other branches
  1. 4.0.x tests/src/Functional/LingotekChangeAccountDefaultsTest.php \Drupal\Tests\lingotek\Functional\LingotekChangeAccountDefaultsTest::assertTableValue()
  2. 3.3.x tests/src/Functional/LingotekChangeAccountDefaultsTest.php \Drupal\Tests\lingotek\Functional\LingotekChangeAccountDefaultsTest::assertTableValue()
  3. 3.4.x tests/src/Functional/LingotekChangeAccountDefaultsTest.php \Drupal\Tests\lingotek\Functional\LingotekChangeAccountDefaultsTest::assertTableValue()
  4. 3.5.x tests/src/Functional/LingotekChangeAccountDefaultsTest.php \Drupal\Tests\lingotek\Functional\LingotekChangeAccountDefaultsTest::assertTableValue()
  5. 3.6.x tests/src/Functional/LingotekChangeAccountDefaultsTest.php \Drupal\Tests\lingotek\Functional\LingotekChangeAccountDefaultsTest::assertTableValue()
  6. 3.8.x tests/src/Functional/LingotekChangeAccountDefaultsTest.php \Drupal\Tests\lingotek\Functional\LingotekChangeAccountDefaultsTest::assertTableValue()

Check to see if two values are equal.

Parameters

$field: The field value to check.

$expected: The expected value to check.

$message: (optional) A message to display with the assertion. Do not translate messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed variables in the message text, not t(). If left blank, a default message will be displayed.

Return value

TRUE if the assertion succeeded, FALSE otherwise.

1 call to LingotekChangeAccountDefaultsTest::assertTableValue()
LingotekChangeAccountDefaultsTest::testChangeCommunity in tests/src/Functional/LingotekChangeAccountDefaultsTest.php

File

tests/src/Functional/LingotekChangeAccountDefaultsTest.php, line 56

Class

LingotekChangeAccountDefaultsTest
Tests changing account defaults.

Namespace

Drupal\Tests\lingotek\Functional

Code

protected function assertTableValue($field, $expected, $message = '') {
  $xpathValue = $this
    ->xpath('//tr[@data-drupal-selector="edit-account-table-' . $field . '-row"]//td[2]');
  $value = $xpathValue[0]
    ->getText();
  return $this
    ->assertEquals($expected, $value, $message);
}