function CommentIntegrationTest::setUp

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

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',
    ]);
    $this->installSchema('system', [
        'sequences',
    ]);
    // 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.