function CommentUninstallTest::setUp

Same name and namespace in other branches
  1. 9 core/modules/comment/tests/src/Kernel/CommentUninstallTest.php \Drupal\Tests\comment\Kernel\CommentUninstallTest::setUp()
  2. 8.9.x core/modules/comment/tests/src/Kernel/CommentUninstallTest.php \Drupal\Tests\comment\Kernel\CommentUninstallTest::setUp()
  3. 11.x 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 37

Class

CommentUninstallTest
Tests comment module uninstall.

Namespace

Drupal\Tests\comment\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this->installEntitySchema('comment');
  $this->installConfig([
    'comment',
  ]);
  $this->installSchema('user', [
    'users_data',
  ]);
  NodeType::create([
    'type' => 'article',
    'name' => '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');
}

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