function EntityDisplayTest::testEntityView

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

Tests the use of regions for entity view displays.

1 method overrides EntityDisplayTest::testEntityView()
ClaroEntityDisplayTest::testEntityView in core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php
Copied from parent.

File

core/modules/field_ui/tests/src/FunctionalJavascript/EntityDisplayTest.php, line 76

Class

EntityDisplayTest
Tests the UI for entity displays.

Namespace

Drupal\Tests\field_ui\FunctionalJavascript

Code

public function testEntityView() : void {
    $this->drupalGet('entity_test/1');
    $this->assertSession()
        ->pageTextNotContains('The field test text value');
    $this->drupalGet('entity_test/structure/entity_test/display');
    $this->assertSession()
        ->elementExists('css', '.region-content-message.region-empty');
    $this->getSession()
        ->getPage()
        ->pressButton('Show row weights');
    $this->assertSession()
        ->waitForElementVisible('css', '[name="fields[field_test_text][region]"]');
    $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());
    $this->drupalGet('entity_test/1');
    $this->assertSession()
        ->pageTextContains('The field test text value');
}

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