function FieldLayoutTest::getRegionTitles

Same name in this branch
  1. 10 core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php \Drupal\Tests\field_layout\FunctionalJavascript\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. 11.x core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php \Drupal\Tests\field_layout\FunctionalJavascript\FieldLayoutTest::getRegionTitles()
  6. 11.x 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::testNodeView in core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php
Tests an entity type that has fields shown by default.
FieldLayoutTest::testRegionChanges in core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php
Tests that changes to the regions still leave the fields visible.

File

core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php, line 94

Class

FieldLayoutTest
Tests using field layout for entity displays.

Namespace

Drupal\Tests\field_layout\Functional

Code

protected function getRegionTitles() {
    $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.