You are here

protected function ModuleIntegrationTest::checkHighlightedText in Thunder 8.3

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

Check more highlighted text in rows.

Parameters

string $fieldName: Human defined field name.

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

array $highlightedTextRows: New highlighted texts per row.

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

File

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

Class

ModuleIntegrationTest
Testing of module integrations.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

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