3 namespace Drupal\Tests\comment\Kernel\Migrate;
5 use Drupal\comment\Entity\CommentType;
6 use Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase;
7 use Drupal\migrate_drupal\Tests\StubTestTrait;
8 use Drupal\node\Entity\NodeType;
11 * Test stub creation for comment entities.
15 class MigrateCommentStubTest extends MigrateDrupalTestBase {
22 public static $modules = ['comment', 'node'];
27 protected function setUp() {
29 $this->installEntitySchema('comment');
30 $this->installEntitySchema('node');
31 $this->installSchema('system', ['sequences']);
33 // Make sure uid 0 is created (default uid for comments is 0).
34 $storage = \Drupal::entityManager()->getStorage('user');
35 // Insert a row for the anonymous user.
43 // Need at least one node type and comment type present.
45 'type' => 'testnodetype',
46 'name' => 'Test node type',
49 'id' => 'testcommenttype',
50 'label' => 'Test comment type',
51 'target_entity_type_id' => 'node',
56 * Tests creation of comment stubs.
58 public function testStub() {
59 $this->performStubTest('comment');