function EntityDisplayTest::testEntityView
Tests the use of regions for entity view displays.
File
-
core/
modules/ field_ui/ tests/ src/ Functional/ EntityDisplayTest.php, line 40
Class
- EntityDisplayTest
- Tests the UI for entity displays.
Namespace
Drupal\Tests\field_ui\FunctionalCode
public function testEntityView() : void {
$this->drupalGet('entity_test/structure/entity_test/display');
$this->assertSession()
->elementExists('css', '.region-content-message.region-empty');
$this->assertTrue($this->assertSession()
->optionExists('fields[field_test_text][region]', 'hidden')
->isSelected());
$this->getSession()
->getPage()
->selectFieldOption('fields[field_test_text][region]', 'content');
$this->assertTrue($this->assertSession()
->optionExists('fields[field_test_text][region]', 'content')
->isSelected());
$this->submitForm([], 'Save');
$this->assertSession()
->pageTextContains('Your settings have been saved.');
$this->assertTrue($this->assertSession()
->optionExists('fields[field_test_text][region]', 'content')
->isSelected());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.