You are here

public function FieldLayoutTest::testNodeView in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php \Drupal\Tests\field_layout\Functional\FieldLayoutTest::testNodeView()

Tests an entity type that has fields shown by default.

File

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

Class

FieldLayoutTest
Tests using field layout for entity displays.

Namespace

Drupal\Tests\field_layout\Functional

Code

public function testNodeView() {

  // By default, the one-column layout is used.
  $this
    ->drupalGet('node/1');
  $this
    ->assertSession()
    ->elementExists('css', '.layout--onecol');
  $this
    ->assertSession()
    ->elementExists('css', '.layout__region--content .field--name-body');
  $this
    ->drupalGet('admin/structure/types/manage/article/display');
  $this
    ->assertEquals([
    'Content',
    'Disabled',
  ], $this
    ->getRegionTitles());
  $this
    ->assertSession()
    ->optionExists('fields[body][region]', 'content');
}