You are here

public function MigrateUserProfileValuesTest::testUserProfileValues in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/src/Tests/Migrate/d6/MigrateUserProfileValuesTest.php \Drupal\user\Tests\Migrate\d6\MigrateUserProfileValuesTest::testUserProfileValues()

Tests Drupal 6 profile values to Drupal 8 migration.

File

core/modules/user/src/Tests/Migrate/d6/MigrateUserProfileValuesTest.php, line 39
Contains \Drupal\user\Tests\Migrate\d6\MigrateUserProfileValuesTest.

Class

MigrateUserProfileValuesTest
User profile values migration.

Namespace

Drupal\user\Tests\Migrate\d6

Code

public function testUserProfileValues() {
  $user = User::load(2);
  $this
    ->assertFalse(is_null($user));
  $this
    ->assertIdentical('red', $user->profile_color->value);
  $expected = <<<EOT
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam nulla sapien, congue nec risus ut, adipiscing aliquet felis. Maecenas quis justo vel nulla varius euismod. Quisque metus metus, cursus sit amet sem non, bibendum vehicula elit. Cras dui nisl, eleifend at iaculis vitae, lacinia ut felis. Nullam aliquam ligula volutpat nulla consectetur accumsan. Maecenas tincidunt molestie diam, a accumsan enim fringilla sit amet. Morbi a tincidunt tellus. Donec imperdiet scelerisque porta. Sed quis sem bibendum eros congue sodales. Vivamus vel fermentum est, at rutrum orci. Nunc consectetur purus ut dolor pulvinar, ut volutpat felis congue. Cras tincidunt odio sed neque sollicitudin, vehicula tempor metus scelerisque.
EOT;
  $this
    ->assertIdentical($expected, $user->profile_biography->value);
  $this
    ->assertIdentical('1', $user->profile_sell_address->value);
  $this
    ->assertIdentical('Back\\slash', $user->profile_sold_to->value);
  $this
    ->assertIdentical('AC/DC', $user->profile_bands[0]->value);
  $this
    ->assertIdentical('Eagles', $user->profile_bands[1]->value);
  $this
    ->assertIdentical('Elton John', $user->profile_bands[2]->value);
  $this
    ->assertIdentical('Lemonheads', $user->profile_bands[3]->value);
  $this
    ->assertIdentical('Rolling Stones', $user->profile_bands[4]->value);
  $this
    ->assertIdentical('Queen', $user->profile_bands[5]->value);
  $this
    ->assertIdentical('The White Stripes', $user->profile_bands[6]->value);
  $this
    ->assertIdentical('1974-06-02', $user->profile_birthdate->value);
  $user = User::load(8);
  $this
    ->assertIdentical('Forward/slash', $user->profile_sold_to->value);
  $user = User::load(15);
  $this
    ->assertIdentical('Dot.in.the.middle', $user->profile_sold_to->value);
}