function FieldLayoutTest::assertFieldInRegion

Same name in other branches
  1. 8.9.x core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php \Drupal\Tests\field_layout\FunctionalJavascript\FieldLayoutTest::assertFieldInRegion()
  2. 10 core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php \Drupal\Tests\field_layout\FunctionalJavascript\FieldLayoutTest::assertFieldInRegion()
  3. 11.x core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php \Drupal\Tests\field_layout\FunctionalJavascript\FieldLayoutTest::assertFieldInRegion()

Asserts that a field exists in a given region.

@internal

Parameters

string $field_selector: The field selector, one of field id|name|label|value.

string $region_name: The machine name of the region.

1 call to FieldLayoutTest::assertFieldInRegion()
FieldLayoutTest::testEntityForm in core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php
Tests the use of field layout for entity form displays.

File

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

Class

FieldLayoutTest
Tests using field layout for entity displays.

Namespace

Drupal\Tests\field_layout\FunctionalJavascript

Code

protected function assertFieldInRegion(string $field_selector, string $region_name) : void {
    $region_element = $this->getSession()
        ->getPage()
        ->find('css', ".layout__region--{$region_name}");
    $this->assertNotNull($region_element);
    $this->assertSession()
        ->fieldExists($field_selector, $region_element);
}

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