You are here

public function MigrateUserContactSettingsTest::testUserContactSettings in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserContactSettingsTest.php \Drupal\Tests\user\Kernel\Migrate\d6\MigrateUserContactSettingsTest::testUserContactSettings()

Tests the Drupal6 user contact settings migration.

File

core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserContactSettingsTest.php, line 32

Class

MigrateUserContactSettingsTest
Users contact settings migration.

Namespace

Drupal\Tests\user\Kernel\Migrate\d6

Code

public function testUserContactSettings() {
  $user_data = \Drupal::service('user.data');
  $module = $key = 'contact';
  $uid = 2;
  $setting = $user_data
    ->get($module, $uid, $key);
  $this
    ->assertSame('1', $setting);
  $uid = 8;
  $setting = $user_data
    ->get($module, $uid, $key);
  $this
    ->assertSame('0', $setting);
  $uid = 15;
  $setting = $user_data
    ->get($module, $uid, $key);
  $this
    ->assertNull($setting);
}