3 namespace Drupal\Tests\comment\Kernel\Migrate\d7;
5 use Drupal\Core\Entity\Entity\EntityFormDisplay;
6 use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
9 * Tests migration of comment form's subject display configuration.
13 class MigrateCommentEntityFormDisplaySubjectTest extends MigrateDrupal7TestBase {
15 public static $modules = ['node', 'comment', 'text', 'menu_ui'];
20 protected function setUp() {
22 $this->installConfig(static::$modules);
23 $this->executeMigrations([
26 'd7_comment_entity_form_display_subject',
31 * Asserts a display entity.
36 protected function assertDisplay($id) {
37 $component = EntityFormDisplay::load($id)->getComponent('subject');
38 $this->assertTrue(is_array($component));
39 $this->assertIdentical('string_textfield', $component['type']);
40 $this->assertIdentical(10, $component['weight']);
44 * Tests the migrated display configuration.
46 public function testMigration() {
47 $this->assertDisplay('comment.comment_node_page.default');
48 $this->assertDisplay('comment.comment_node_article.default');
49 $this->assertDisplay('comment.comment_node_book.default');
50 $this->assertDisplay('comment.comment_node_blog.default');
51 $this->assertDisplay('comment.comment_node_forum.default');
52 $this->assertDisplay('comment.comment_node_test_content_type.default');