You are here

public function MigrateUserContactSettingsTest::testUserContactSettings in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserContactSettingsTest.php \Drupal\Tests\user\Kernel\Migrate\d6\MigrateUserContactSettingsTest::testUserContactSettings()
  2. 10 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
    ->assertIdentical('1', $setting);
  $uid = 8;
  $setting = $user_data
    ->get($module, $uid, $key);
  $this
    ->assertIdentical('0', $setting);
  $uid = 15;
  $setting = $user_data
    ->get($module, $uid, $key);
  $this
    ->assertIdentical(NULL, $setting);
}