Commit f34368b7 authored by alexpott's avatar alexpott
Browse files

Issue #2302253 by ultimike | Ryan Weal: Fixed User profile "selection" type...

Issue #2302253 by ultimike | Ryan Weal: Fixed User profile "selection" type field type does not migrate from D6 if any of the available options contain a dot.
parent 87cb9a69
......@@ -449,21 +449,21 @@ public static function getData($table) {
array('fid' => 8, 'uid' => 2, 'value' => 'red'),
array('fid' => 9, 'uid' => 2, 'value' => '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.'),
array('fid' => 10, 'uid' => 2, 'value' => '1'),
array('fid' => 11, 'uid' => 2, 'value' => 'Fitness spammers'),
array('fid' => 11, 'uid' => 2, 'value' => 'Back\slash'),
array('fid' => 12, 'uid' => 2, 'value' => "AC/DC\n,,Eagles\r\nElton John,Lemonheads\r\n\r\nRolling Stones\rQueen\nThe White Stripes"),
array('fid' => 13, 'uid' => 2, 'value' => "http://example.com/blog"),
array('fid' => 14, 'uid' => 2, 'value' => 'a:3:{s:5:"month";s:1:"6";s:3:"day";s:1:"2";s:4:"year";s:4:"1974";}'),
array('fid' => 8, 'uid' => 8, 'value' => 'brown'),
array('fid' => 9, 'uid' => 8, 'value' => 'Nunc condimentum ligula felis, eget lacinia purus accumsan at. Pellentesque eu lobortis felis. Duis at accumsan nisl, vel pulvinar risus. Nullam venenatis, tellus non eleifend hendrerit, augue nulla rhoncus leo, eget convallis enim sem ut velit. Mauris tincidunt enim ut eros volutpat dapibus. Curabitur augue libero, imperdiet eget orci sed, malesuada dapibus tellus. Nam lacus sapien, convallis vitae quam vel, bibendum commodo odio.'),
array('fid' => 10, 'uid' => 8, 'value' => '0'),
array('fid' => 11, 'uid' => 8, 'value' => 'Spammers'),
array('fid' => 11, 'uid' => 8, 'value' => 'Forward/slash'),
array('fid' => 12, 'uid' => 8, 'value' => "Deep Purple\nWho\nThe Beatles"),
array('fid' => 13, 'uid' => 8, 'value' => "http://blog.example.com"),
array('fid' => 14, 'uid' => 8, 'value' => 'a:3:{s:5:"month";s:1:"9";s:3:"day";s:1:"9";s:4:"year";s:4:"1980";}'),
array('fid' => 8, 'uid' => 15, 'value' => 'orange'),
array('fid' => 9, 'uid' => 15, 'value' => 'Donec a diam volutpat augue fringilla fringilla. Mauris ultricies turpis ut lacus tempus, vitae pharetra lacus mattis. Nulla semper dui euismod sem bibendum, in eleifend nisi malesuada. Vivamus orci mauris, volutpat vitae enim ac, aliquam tempus lectus.'),
array('fid' => 10, 'uid' => 15, 'value' => '1'),
array('fid' => 11, 'uid' => 15, 'value' => 'Pill spammers'),
array('fid' => 11, 'uid' => 15, 'value' => 'Dot.in.the.middle'),
array('fid' => 12, 'uid' => 15, 'value' => "ABBA\nBoney M"),
array('fid' => 13, 'uid' => 15, 'value' => "http://example.com/journal"),
array('fid' => 14, 'uid' => 15, 'value' => 'a:3:{s:5:"month";s:2:"11";s:3:"day";s:2:"25";s:4:"year";s:4:"1982";}'),
......
......@@ -186,7 +186,7 @@ public static function getData($table) {
'register' => '0',
'visibility' => '4',
'autocomplete' => '0',
'options' => "Pill spammers\r\nFitness spammers",
'options' => "Pill spammers\r\nFitness spammers\r\nBack\slash\r\nForward/slash\r\nDot.in.the.middle",
),
array(
'fid' => '12',
......
......@@ -258,7 +258,7 @@ protected function getTestClassesList() {
__NAMESPACE__ . '\MigrateNodeRevisionTest',
__NAMESPACE__ . '\MigrateNodeTest',
__NAMESPACE__ . '\MigrateNodeTypeTest',
__NAMESPACE__ . '\MigrateProfileValuesTest',
__NAMESPACE__ . '\MigrateUserProfileValuesTest',
__NAMESPACE__ . '\MigrateSearchConfigsTest',
__NAMESPACE__ . '\MigrateSearchPageTest',
__NAMESPACE__ . '\MigrateSimpletestConfigsTest',
......
......@@ -57,8 +57,10 @@ public function testUserProfileFields() {
$settings = $field_storage->getSettings();
$this->assertEqual($settings['allowed_values'], array(
'Pill spammers' => 'Pill spammers',
'Spammers' => 'Spammers',
'Fitness spammers' => 'Fitness spammers',
'Back\slash' => 'Back\slash',
'Forward/slash' => 'Forward/slash',
'Dot.in.the.middle' => 'Dot.in.the.middle',
'Faithful servant' => 'Faithful servant',
'Anonymous donor' => 'Anonymous donor',
));
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\migrate_drupal\Tests\d6\MigrateProfileValuesTest.
* Contains \Drupal\migrate_drupal\Tests\d6\MigrateUserProfileValuesTest.
*/
namespace Drupal\migrate_drupal\Tests\d6;
......@@ -18,7 +18,7 @@
*
* @group migrate_drupal
*/
class MigrateProfileValuesTest extends MigrateDrupalTestBase {
class MigrateUserProfileValuesTest extends MigrateDrupalTestBase {
/**
* The modules to be enabled during the test.
......@@ -147,7 +147,7 @@ public function testUserProfileValues() {
$this->assertEqual($user->profile_color->value, 'red');
$this->assertEqual($user->profile_biography->value, '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.');
$this->assertEqual($user->profile_sell_address->value, '1');
$this->assertEqual($user->profile_sold_to->value, 'Fitness spammers');
$this->assertEqual($user->profile_sold_to->value, 'Back\slash');
$this->assertEqual($user->profile_bands[0]->value, 'AC/DC');
$this->assertEqual($user->profile_bands[1]->value, 'Eagles');
$this->assertEqual($user->profile_bands[2]->value, 'Elton John');
......@@ -156,6 +156,12 @@ public function testUserProfileValues() {
$this->assertEqual($user->profile_bands[5]->value, 'Queen');
$this->assertEqual($user->profile_bands[6]->value, 'The White Stripes');
$this->assertEqual($user->profile_birthdate->value, '1974-06-02');
$user = User::load(8);
$this->assertEqual($user->profile_sold_to->value, 'Forward/slash');
$user = User::load(15);
$this->assertEqual($user->profile_sold_to->value, 'Dot.in.the.middle');
}
}
......@@ -7,6 +7,8 @@
namespace Drupal\migrate_drupal\Tests\d6;
use Drupal\user\Entity\User;
use Drupal\file\Entity\File;
use Drupal\Core\Database\Database;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
......@@ -151,7 +153,7 @@ public function testUser() {
$migration_format = entity_load('migration', 'd6_filter_format');
$signature_format = $migration_format->getIdMap()->lookupDestinationId(array($source->signature_format));
$user = user_load($source->uid);
$user = User::load($source->uid);
$this->assertEqual($user->id(), $source->uid);
$this->assertEqual($user->label(), $source->name);
$this->assertEqual($user->getEmail(), $source->mail);
......@@ -174,7 +176,7 @@ public function testUser() {
// We have one empty picture in the data so don't try load that.
if (!empty($source->picture)) {
// Test the user picture.
$file = file_load($user->user_picture->target_id);
$file = File::load($user->user_picture->target_id);
$this->assertEqual($file->getFilename(), basename($source->picture));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment