You are here

protected function DevelStateEditorTest::assertElementsTextEquals in Devel 8

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/DevelStateEditorTest.php \Drupal\Tests\devel\Functional\DevelStateEditorTest::assertElementsTextEquals()
  2. 8.2 tests/src/Functional/DevelStateEditorTest.php \Drupal\Tests\devel\Functional\DevelStateEditorTest::assertElementsTextEquals()
  3. 4.x tests/src/Functional/DevelStateEditorTest.php \Drupal\Tests\devel\Functional\DevelStateEditorTest::assertElementsTextEquals()

Checks that the passed in elements have the expected text.

Parameters

\Behat\Mink\Element\NodeElement[] $elements: The elements for which check the text.

array $expected_elements_text: The expected text for the passed in elements.

1 call to DevelStateEditorTest::assertElementsTextEquals()
DevelStateEditorTest::testStateListing in tests/src/Functional/DevelStateEditorTest.php
Tests state listing.

File

tests/src/Functional/DevelStateEditorTest.php, line 202

Class

DevelStateEditorTest
Tests devel state editor.

Namespace

Drupal\Tests\devel\Functional

Code

protected function assertElementsTextEquals(array $elements, array $expected_elements_text) {
  $actual_text = array_map(function (NodeElement $element) {
    return $element
      ->getText();
  }, $elements);
  $this
    ->assertSame($expected_elements_text, $actual_text);
}