You are here

protected function CommentEntityTest::setUp in Drupal 8

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

Overrides CommentTestBase::setUp

File

core/modules/comment/tests/src/Functional/CommentEntityTest.php, line 44

Class

CommentEntityTest
Tests comments with other entities.

Namespace

Drupal\Tests\comment\Functional

Code

protected function setUp() {
  parent::setUp();
  $this->vocab = $this
    ->createVocabulary();
  $this->commentType = CommentType::create([
    'id' => 'taxonomy_comment',
    'label' => 'Taxonomy comment',
    'description' => '',
    'target_entity_type_id' => 'taxonomy_term',
  ]);
  $this->commentType
    ->save();
  $this
    ->addDefaultCommentField('taxonomy_term', $this->vocab
    ->id(), 'field_comment', CommentItemInterface::OPEN, $this->commentType
    ->id());
}