3 namespace Drupal\Tests\user\Kernel\Migrate;
5 use Drupal\Core\Entity\Entity\EntityFormDisplay;
6 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
9 * Tests the user profile entity form display migration.
11 * @group migrate_drupal_6
13 class MigrateUserProfileEntityFormDisplayTest extends MigrateDrupal6TestBase {
18 protected function setUp() {
20 $this->executeMigrations([
22 'user_profile_field_instance',
23 'user_profile_entity_form_display',
28 * Tests migration of user profile fields.
30 public function testUserProfileEntityFormDisplay() {
31 $display = EntityFormDisplay::load('user.user.default');
34 $component = $display->getComponent('profile_color');
35 $this->assertIdentical('text_textfield', $component['type']);
38 $component = $display->getComponent('profile_bands');
39 $this->assertIdentical('text_textfield', $component['type']);
42 $component = $display->getComponent('profile_birthdate');
43 $this->assertIdentical('datetime_default', $component['type']);
45 // Test PROFILE_PRIVATE field is hidden.
46 $this->assertNull($display->getComponent('profile_sell_address'));
48 // Test PROFILE_HIDDEN field is hidden.
49 $this->assertNull($display->getComponent('profile_sold_to'));
51 // Test that a checkbox field has the proper display label setting.
52 $component = $display->getComponent('profile_love_migrations');
53 $this->assertIdentical('boolean_checkbox', $component['type']);
54 $this->assertIdentical(TRUE, $component['settings']['display_label']);