You are here

public function GroupTest::testGroupEntityViewModes in Group 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Kernel/GroupTest.php \Drupal\Tests\group\Kernel\GroupTest::testGroupEntityViewModes()

Tests creating group view modes.

@uses Drupal\Core\Entity\Entity\EntityViewDisplay @uses Drupal\Core\Entity\Entity\EntityViewMode

File

tests/src/Kernel/GroupTest.php, line 62

Class

GroupTest
Tests the general behavior of group entities.

Namespace

Drupal\Tests\group\Kernel

Code

public function testGroupEntityViewModes() {
  EntityViewMode::create([
    'id' => 'group.teaser',
    'targetEntityType' => 'group',
    'status' => TRUE,
    'enabled' => TRUE,
    'label' => 'Group teaser',
  ])
    ->save();
  $group_type = $this
    ->createGroupType();
  EntityViewDisplay::create([
    'targetEntityType' => 'group',
    'bundle' => $group_type
      ->id(),
    'mode' => 'teaser',
    'label' => 'Teaser',
    'status' => TRUE,
  ])
    ->save();
}