function MigrateUserContactSettingsTest::testUserContactSettings

Same name in other branches
  1. 9 core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserContactSettingsTest.php \Drupal\Tests\user\Kernel\Migrate\d6\MigrateUserContactSettingsTest::testUserContactSettings()
  2. 8.9.x core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserContactSettingsTest.php \Drupal\Tests\user\Kernel\Migrate\d6\MigrateUserContactSettingsTest::testUserContactSettings()
  3. 11.x 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 34

Class

MigrateUserContactSettingsTest
Users contact settings migration.

Namespace

Drupal\Tests\user\Kernel\Migrate\d6

Code

public function testUserContactSettings() : void {
    $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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.