class EntityDisplayTest in Drupal 10
Same name in this branch
- 10 core/modules/field_ui/tests/src/Functional/EntityDisplayTest.php \Drupal\Tests\field_ui\Functional\EntityDisplayTest
- 10 core/modules/field_ui/tests/src/FunctionalJavascript/EntityDisplayTest.php \Drupal\Tests\field_ui\FunctionalJavascript\EntityDisplayTest
- 10 core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php \Drupal\Tests\field_ui\Kernel\EntityDisplayTest
Same name and namespace in other branches
- 8 core/modules/field_ui/tests/src/Functional/EntityDisplayTest.php \Drupal\Tests\field_ui\Functional\EntityDisplayTest
- 9 core/modules/field_ui/tests/src/Functional/EntityDisplayTest.php \Drupal\Tests\field_ui\Functional\EntityDisplayTest
Tests the UI for entity displays.
@group field_ui
Hierarchy
- class \Drupal\Tests\BrowserTestBase extends \PHPUnit\Framework\TestCase uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, FunctionalTestSetupTrait, TestSetupTrait, BlockCreationTrait, ConfigTestTrait, ExtensionListTestTrait, ContentTypeCreationTrait, NodeCreationTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings, UiHelperTrait, UserCreationTrait, XdebugRequestTrait
- class \Drupal\Tests\field_ui\Functional\EntityDisplayTest
Expanded class hierarchy of EntityDisplayTest
File
- core/
modules/ field_ui/ tests/ src/ Functional/ EntityDisplayTest.php, line 12
Namespace
Drupal\Tests\field_ui\FunctionalView source
class EntityDisplayTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'field_ui',
'entity_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this
->drupalLogin($this
->drupalCreateUser([
'administer entity_test display',
]));
}
/**
* Tests the use of regions for entity view displays.
*/
public function testEntityView() {
$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());
}
}