You are here

protected function FlatCommentsPidTest::setUp in Flatcomments 8

Overrides KernelTestBase::setUp

File

tests/src/Kernel/FlatCommentsPidTest.php, line 36

Class

FlatCommentsPidTest
Tests the new entity API for the comment field type.

Namespace

Drupal\Tests\flat_comments\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('comment');
  $this
    ->installSchema('comment', [
    'comment_entity_statistics',
  ]);
  $this
    ->installConfig([
    'comment',
  ]);
  $this
    ->installEntitySchema('entity_test');
  $this
    ->installEntitySchema('user');
  $this
    ->installSchema('system', [
    'sequences',
    'key_value',
  ]);

  // Set default storage backend and configure the theme system.
  $this
    ->installConfig([
    'field',
    'system',
  ]);

  // Create user 1.
  $storage = \Drupal::entityTypeManager()
    ->getStorage('user');
  $storage
    ->create([
    'uid' => 1,
    'name' => 'entity-test',
    'mail' => 'entity@localhost',
    'status' => TRUE,
  ])
    ->save();
}