function FieldLayoutTest::getRegionTitles

Same name in this branch
  1. 11.x core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php \Drupal\Tests\field_layout\Functional\FieldLayoutTest::getRegionTitles()
Same name in other branches
  1. 9 core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php \Drupal\Tests\field_layout\FunctionalJavascript\FieldLayoutTest::getRegionTitles()
  2. 9 core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php \Drupal\Tests\field_layout\Functional\FieldLayoutTest::getRegionTitles()
  3. 8.9.x core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php \Drupal\Tests\field_layout\FunctionalJavascript\FieldLayoutTest::getRegionTitles()
  4. 8.9.x core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php \Drupal\Tests\field_layout\Functional\FieldLayoutTest::getRegionTitles()
  5. 10 core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php \Drupal\Tests\field_layout\FunctionalJavascript\FieldLayoutTest::getRegionTitles()
  6. 10 core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php \Drupal\Tests\field_layout\Functional\FieldLayoutTest::getRegionTitles()

Gets the region titles on the page.

Return value

string[] An array of region titles.

2 calls to FieldLayoutTest::getRegionTitles()
FieldLayoutTest::testEntityForm in core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php
Tests the use of field layout for entity form displays.
FieldLayoutTest::testEntityView in core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php
Tests the use of field layout for entity view displays.

File

core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php, line 295

Class

FieldLayoutTest
Tests using field layout for entity displays.

Namespace

Drupal\Tests\field_layout\FunctionalJavascript

Code

protected function getRegionTitles() : array {
    $region_titles = [];
    $region_title_elements = $this->getSession()
        ->getPage()
        ->findAll('css', '.region-title td');
    
    /** @var \Behat\Mink\Element\NodeElement[] $region_title_elements */
    foreach ($region_title_elements as $region_title_element) {
        $region_titles[] = $region_title_element->getText();
    }
    return $region_titles;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.