You are here

protected function ModuleIntegrationTest::checkFullText in Thunder 8.3

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/ModuleIntegrationTest.php \Drupal\Tests\thunder\FunctionalJavascript\ModuleIntegrationTest::checkFullText()
  2. 8.2 tests/src/FunctionalJavascript/ModuleIntegrationTest.php \Drupal\Tests\thunder\FunctionalJavascript\ModuleIntegrationTest::checkFullText()
  3. 8.4 tests/src/FunctionalJavascript/ModuleIntegrationTest.php \Drupal\Tests\thunder\FunctionalJavascript\ModuleIntegrationTest::checkFullText()
  4. 6.2.x tests/src/FunctionalJavascript/ModuleIntegrationTest.php \Drupal\Tests\thunder\FunctionalJavascript\ModuleIntegrationTest::checkFullText()
  5. 6.0.x tests/src/FunctionalJavascript/ModuleIntegrationTest.php \Drupal\Tests\thunder\FunctionalJavascript\ModuleIntegrationTest::checkFullText()
  6. 6.1.x tests/src/FunctionalJavascript/ModuleIntegrationTest.php \Drupal\Tests\thunder\FunctionalJavascript\ModuleIntegrationTest::checkFullText()

Check full text in column defined by index.

Parameters

string $fieldName: Human defined field name.

int $columnIndex: Index of column in diff table that should be used to check.

array $textRows: Associative array with text per row.

1 call to ModuleIntegrationTest::checkFullText()
ModuleIntegrationTest::validateDiff in tests/src/FunctionalJavascript/ModuleIntegrationTest.php
Validate diff entry for one field.

File

tests/src/FunctionalJavascript/ModuleIntegrationTest.php, line 70

Class

ModuleIntegrationTest
Testing of module integrations.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

protected function checkFullText($fieldName, $columnIndex, array $textRows = []) {
  $page = $this
    ->getSession()
    ->getPage();
  foreach ($textRows as $indexRow => $expectedText) {
    $previousText = $page
      ->find('xpath', "//tr[./td[text()=\"{$fieldName}\"]]/following-sibling::tr[{$indexRow}]/td[{$columnIndex}]")
      ->getText();
    $this
      ->assertEquals($expectedText, htmlspecialchars_decode($previousText, ENT_QUOTES | ENT_HTML401));
  }
}