MigrateCommentStubTest.php in Drupal 10
File
core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php
View source
<?php
namespace Drupal\Tests\comment\Kernel\Migrate;
use Drupal\comment\Entity\CommentType;
use Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase;
use Drupal\migrate_drupal\Tests\StubTestTrait;
use Drupal\node\Entity\NodeType;
class MigrateCommentStubTest extends MigrateDrupalTestBase {
use StubTestTrait;
protected static $modules = [
'comment',
'node',
];
protected function setUp() : void {
parent::setUp();
$this
->installEntitySchema('comment');
$this
->installEntitySchema('node');
$this
->installSchema('system', [
'sequences',
]);
$storage = \Drupal::entityTypeManager()
->getStorage('user');
$storage
->create([
'uid' => 0,
'status' => 0,
'name' => '',
])
->save();
NodeType::create([
'type' => 'testnodetype',
'name' => 'Test node type',
])
->save();
CommentType::create([
'id' => 'testcommenttype',
'label' => 'Test comment type',
'target_entity_type_id' => 'node',
])
->save();
}
public function testStub() {
$this
->performStubTest('comment');
}
}