You are here

protected function CommentUninstallTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/comment/tests/src/Kernel/CommentUninstallTest.php \Drupal\Tests\comment\Kernel\CommentUninstallTest::setUp()
  2. 10 core/modules/comment/tests/src/Kernel/CommentUninstallTest.php \Drupal\Tests\comment\Kernel\CommentUninstallTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/comment/tests/src/Kernel/CommentUninstallTest.php, line 35

Class

CommentUninstallTest
Tests comment module uninstall.

Namespace

Drupal\Tests\comment\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('comment');
  $this
    ->installConfig([
    'comment',
  ]);
  $this
    ->installSchema('user', [
    'users_data',
  ]);
  NodeType::create([
    'type' => 'article',
  ])
    ->save();

  // Create comment field on article so that it adds 'comment_body' field.
  FieldStorageConfig::create([
    'type' => 'text_long',
    'entity_type' => 'comment',
    'field_name' => 'comment',
  ])
    ->save();
  $this
    ->addDefaultCommentField('node', 'article');
}