CommentEntityFormDisplayTest.php in Commerce Migrate 8.2
File
modules/ubercart/tests/src/Kernel/Migrate/uc7/CommentEntityFormDisplayTest.php
View source
<?php
namespace Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc7;
use Drupal\Core\Entity\Entity\EntityFormDisplay;
class CommentEntityFormDisplayTest extends Ubercart7TestBase {
public static $modules = [
'comment',
'commerce_price',
'commerce_product',
'commerce_store',
'node',
'path',
'text',
];
protected function setUp() {
parent::setUp();
$this
->migrateContentTypes();
$this
->migrateCommentFields();
$this
->executeMigration('uc7_comment_entity_form_display');
}
protected function assertDisplay($id, $component_id) {
$component = EntityFormDisplay::load($id)
->getComponent($component_id);
$this
->assertInternalType('array', $component);
$this
->assertSame('comment_default', $component['type']);
$this
->assertSame(20, $component['weight']);
}
public function testMigration() {
$this
->assertDisplay('commerce_product.product.default', 'comment_node_product');
$this
->assertDisplay('commerce_product.entertainment.default', 'comment_node_entertainment');
}
}