CommentTypeTest.php in Commerce Migrate 8.2
File
modules/ubercart/tests/src/Kernel/Migrate/uc7/CommentTypeTest.php
View source
<?php
namespace Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc7;
use Drupal\comment\Entity\CommentType;
class CommentTypeTest extends Ubercart7TestBase {
public static $modules = [
'node',
'comment',
'text',
];
protected function setUp() {
parent::setUp();
$this
->installEntitySchema('comment');
$this
->installConfig([
'comment',
]);
$this
->executeMigration('uc7_comment_type');
}
protected function assertEntity($id, $label) {
$entity = CommentType::load($id);
$this
->assertInstanceOf(CommentType::class, $entity);
$this
->assertSame($label, $entity
->label());
$this
->assertSame('commerce_product', $entity
->getTargetEntityTypeId());
}
public function testMigration() {
$this
->assertEntity('comment_node_product', 'Product comment');
$this
->assertEntity('comment_node_entertainment', 'Entertainment comment');
}
}