3 namespace Drupal\Tests\user\Kernel\Migrate;
5 use Drupal\Core\Entity\Entity\EntityViewDisplay;
6 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
9 * Tests the user profile entity display migration.
11 * @group migrate_drupal_6
13 class MigrateUserProfileEntityDisplayTest extends MigrateDrupal6TestBase {
18 protected function setUp() {
20 $this->executeMigrations([
22 'user_profile_field_instance',
23 'user_profile_entity_display',
28 * Tests migration of user profile fields.
30 public function testUserProfileFields() {
31 $display = EntityViewDisplay::load('user.user.default');
34 $component = $display->getComponent('profile_color');
35 $this->assertIdentical('text_default', $component['type']);
38 $component = $display->getComponent('profile_bands');
39 $this->assertIdentical('text_default', $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 a checkbox field.
52 $component = $display->getComponent('profile_really_really_love_mig');
53 $this->assertIdentical('list_default', $component['type']);