MigrateCommentEntityFormDisplaySubjectTest.php in Zircon Profile 8
File
core/modules/comment/src/Tests/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php
View source
<?php
namespace Drupal\comment\Tests\Migrate\d7;
use Drupal\Core\Entity\Entity\EntityFormDisplay;
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
class MigrateCommentEntityFormDisplaySubjectTest extends MigrateDrupal7TestBase {
public static $modules = [
'node',
'comment',
'text',
];
protected function setUp() {
parent::setUp();
$this
->installConfig(static::$modules);
$this
->executeMigrations([
'd7_node_type',
'd7_comment_type',
'd7_comment_entity_form_display_subject',
]);
}
protected function assertDisplay($id) {
$component = EntityFormDisplay::load($id)
->getComponent('subject');
$this
->assertTrue(is_array($component));
$this
->assertIdentical('string_textfield', $component['type']);
$this
->assertIdentical(10, $component['weight']);
}
public function testMigration() {
$this
->assertDisplay('comment.comment_node_page.default');
$this
->assertDisplay('comment.comment_node_article.default');
$this
->assertDisplay('comment.comment_node_book.default');
$this
->assertDisplay('comment.comment_node_blog.default');
$this
->assertDisplay('comment.comment_node_forum.default');
$this
->assertDisplay('comment.comment_node_test_content_type.default');
}
}