MigrateUserContactSettingsTest.php in Drupal 8
File
core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserContactSettingsTest.php
View source
<?php
namespace Drupal\Tests\user\Kernel\Migrate\d6;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
class MigrateUserContactSettingsTest extends MigrateDrupal6TestBase {
public static $modules = [
'contact',
];
protected function setUp() {
parent::setUp();
$this
->migrateUsers(FALSE);
$this
->installSchema('user', [
'users_data',
]);
$this
->executeMigration('d6_user_contact_settings');
}
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);
}
}