public function MigrateUserProfileEntityDisplayTest::testUserProfileFields in Drupal 9
Same name and namespace in other branches
- 8 core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileEntityDisplayTest.php \Drupal\Tests\user\Kernel\Migrate\d6\MigrateUserProfileEntityDisplayTest::testUserProfileFields()
- 10 core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileEntityDisplayTest.php \Drupal\Tests\user\Kernel\Migrate\d6\MigrateUserProfileEntityDisplayTest::testUserProfileFields()
Tests migration of user profile fields.
File
- core/
modules/ user/ tests/ src/ Kernel/ Migrate/ d6/ MigrateUserProfileEntityDisplayTest.php, line 30
Class
- MigrateUserProfileEntityDisplayTest
- Tests the user profile entity display migration.
Namespace
Drupal\Tests\user\Kernel\Migrate\d6Code
public function testUserProfileFields() {
$display = EntityViewDisplay::load('user.user.default');
// Test a text field.
$component = $display
->getComponent('profile_color');
$this
->assertSame('text_default', $component['type']);
// Test a list field.
$component = $display
->getComponent('profile_bands');
$this
->assertSame('text_default', $component['type']);
// Test a date field.
$component = $display
->getComponent('profile_birthdate');
$this
->assertSame('datetime_default', $component['type']);
// Test PROFILE_PRIVATE field is hidden.
$this
->assertNull($display
->getComponent('profile_sell_address'));
// Test PROFILE_HIDDEN field is hidden.
$this
->assertNull($display
->getComponent('profile_sold_to'));
// Test a checkbox field.
$component = $display
->getComponent('profile_really_really_love_mig');
$this
->assertSame('list_default', $component['type']);
}