function CommentIntegrationTest::setUp

Same name in other branches
  1. 9 core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php \Drupal\Tests\comment\Kernel\CommentIntegrationTest::setUp()
  2. 8.9.x core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php \Drupal\Tests\comment\Kernel\CommentIntegrationTest::setUp()
  3. 10 core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php \Drupal\Tests\comment\Kernel\CommentIntegrationTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php, line 41

Class

CommentIntegrationTest
Tests integration of comment with other components.

Namespace

Drupal\Tests\comment\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $this->installEntitySchema('entity_test');
    $this->installEntitySchema('user');
    $this->installEntitySchema('comment');
    $this->installSchema('dblog', [
        'watchdog',
    ]);
    // Create a new 'comment' comment-type.
    CommentType::create([
        'id' => 'comment',
        'label' => $this->randomString(),
        'target_entity_type_id' => 'entity_test',
    ])
        ->save();
}

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