CommentFieldTest.php in Commerce Migrate 3.0.x
File
modules/ubercart/tests/src/Kernel/Migrate/uc7/CommentFieldTest.php
View source
<?php
namespace Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc7;
use Drupal\field\Entity\FieldStorageConfig;
class CommentFieldTest extends Ubercart7TestBase {
public static $modules = [
'comment',
'commerce_price',
'commerce_product',
'commerce_store',
'node',
'path',
'text',
];
protected function setUp() {
parent::setUp();
$this
->installEntitySchema('commerce_product');
$this
->installConfig([
'comment',
'commerce_product',
]);
$this
->executeMigrations([
'uc7_comment_type',
'uc7_product_type',
'uc7_comment_field',
]);
}
protected function assertEntity($comment_type) {
$entity = FieldStorageConfig::load('commerce_product.' . $comment_type);
$this
->assertInstanceOf(FieldStorageConfig::class, $entity);
$this
->assertSame('commerce_product', $entity
->getTargetEntityTypeId());
$this
->assertSame('comment', $entity
->getType());
$this
->assertSame($comment_type, $entity
->getSetting('comment_type'));
}
public function testMigration() {
$this
->assertEntity('comment_node_product');
$this
->assertEntity('comment_node_entertainment');
}
}