db backup prior to drupal security update
[yaffs-website] / web / core / modules / comment / tests / src / Kernel / Migrate / d6 / MigrateCommentVariableEntityFormDisplaySubjectTest.php
1 <?php
2
3 namespace Drupal\Tests\comment\Kernel\Migrate\d6;
4
5 use Drupal\Core\Entity\Entity\EntityFormDisplay;
6 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
7
8 /**
9  * Upgrade comment subject variable to core.entity_form_display.comment.*.default.yml
10  *
11  * @group migrate_drupal_6
12  */
13 class MigrateCommentVariableEntityFormDisplaySubjectTest extends MigrateDrupal6TestBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public static $modules = ['comment'];
19
20   /**
21    * {@inheritdoc}
22    */
23   protected function setUp() {
24     parent::setUp();
25     $this->installConfig(['comment']);
26     $this->executeMigrations([
27       'd6_comment_type',
28       'd6_comment_entity_form_display_subject',
29     ]);
30   }
31
32   /**
33    * Tests comment subject variable migrated into an entity display.
34    */
35   public function testCommentEntityFormDisplay() {
36     $component = EntityFormDisplay::load('comment.comment.default')
37       ->getComponent('subject');
38     $this->assertIdentical('string_textfield', $component['type']);
39     $this->assertIdentical(10, $component['weight']);
40     $component = EntityFormDisplay::load('comment.comment_no_subject.default')
41       ->getComponent('subject');
42     $this->assertNull($component);
43   }
44
45 }