diff -u b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php --- b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php @@ -79,8 +79,8 @@ // Run tests. $field_name = "field_test"; $expected = array( - 'weight' => 1, 'label' => 'above', + 'weight' => 1, 'type' => 'text_trimmed', 'settings' => array('trim_length' => 600), 'third_party_settings' => array(), @@ -91,21 +91,21 @@ $this->assertNull($display, "Print entity display not found."); // Can we load any entity display. $display = entity_load('entity_view_display', 'node.story.teaser'); - $this->assertEqual($display->getComponent($field_name), $expected); + $this->assertIdentical($display->getComponent($field_name), $expected); // Test migrate worked with multiple bundles. $display = entity_load('entity_view_display', 'node.test_page.teaser'); - $this->assertEqual($display->getComponent($field_name), $expected); + $this->assertIdentical($display->getComponent($field_name), $expected); // Test RSS because that has been converted from 4 to rss. $display = entity_load('entity_view_display', 'node.story.rss'); - $this->assertEqual($display->getComponent($field_name), $expected); + $this->assertIdentical($display->getComponent($field_name), $expected); // Test the default format with text_default which comes from a static map. $expected['type'] = 'text_default'; $expected['settings'] = array(); $display = entity_load('entity_view_display', 'node.story.default'); - $this->assertEqual($display->getComponent($field_name), $expected); + $this->assertIdentical($display->getComponent($field_name), $expected); // Check that we can migrate multiple fields. $content = $display->get('content'); @@ -120,105 +120,109 @@ 'prefix_suffix' => TRUE, ); $component = $display->getComponent('field_test_two'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); $expected['weight'] = 3; $expected['type'] = 'number_decimal'; - $expected['settings']['scale'] = 2; - $expected['settings']['decimal_separator'] = '.'; + $expected['settings'] = array( + 'scale' => 2, + 'decimal_separator' => '.', + 'thousand_separator' => ',', + 'prefix_suffix' => TRUE, + ); $component = $display->getComponent('field_test_three'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // Test the email field formatter settings are correct. $expected['weight'] = 4; $expected['type'] = 'email_mailto'; $expected['settings'] = array(); $component = $display->getComponent('field_test_email'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // Test the link field formatter settings. $expected['weight'] = 5; $expected['type'] = 'link'; $expected['settings'] = array( 'trim_length' => 80, - 'url_only' => 1, - 'url_plain' => 1, - 'rel' => 0, - 'target' => 0, + 'url_only' => TRUE, + 'url_plain' => TRUE, + 'rel' => '0', + 'target' => '0', ); $component = $display->getComponent('field_test_link'); - $this->assertEqual($component, $expected, "node.story.default field_test_link has correct absolute link settings."); - $expected['settings']['url_only'] = 0; - $expected['settings']['url_plain'] = 0; + $this->assertIdentical($component, $expected, "node.story.default field_test_link has correct absolute link settings."); + $expected['settings']['url_only'] = FALSE; + $expected['settings']['url_plain'] = FALSE; $display = entity_load('entity_view_display', 'node.story.teaser'); $component = $display->getComponent('field_test_link'); - $this->assertEqual($component, $expected, "node.story.teaser field_test_link has correct default link settings."); + $this->assertIdentical($component, $expected, "node.story.teaser field_test_link has correct default link settings."); // Test the file field formatter settings. $expected['weight'] = 7; $expected['type'] = 'file_default'; $expected['settings'] = array(); $component = $display->getComponent('field_test_filefield'); - $this->assertEqual($component, $expected, "node.story.teaser field_test_filefield is of type file_default."); + $this->assertIdentical($component, $expected, "node.story.teaser field_test_filefield is of type file_default."); $display = entity_load('entity_view_display', 'node.story.default'); $expected['type'] = 'file_url_plain'; $component = $display->getComponent('field_test_filefield'); - $this->assertEqual($component, $expected, "node.story.default field_test_filefield is of type file_url_plain."); + $this->assertIdentical($component, $expected, "node.story.default field_test_filefield is of type file_url_plain."); // Test the image field formatter settings. $expected['weight'] = 8; $expected['type'] = 'image'; $expected['settings'] = array('image_style' => '', 'image_link' => ''); $component = $display->getComponent('field_test_imagefield'); - $this->assertEqual($component, $expected, "node.story.default field_test_imagefield is of type image with the correct settings."); + $this->assertIdentical($component, $expected, "node.story.default field_test_imagefield is of type image with the correct settings."); $display = entity_load('entity_view_display', 'node.story.teaser'); $expected['settings']['image_link'] = 'file'; $component = $display->getComponent('field_test_imagefield'); - $this->assertEqual($component, $expected, "node.story.teaser field_test_imagefield is of type image with the correct settings."); + $this->assertIdentical($component, $expected, "node.story.teaser field_test_imagefield is of type image with the correct settings."); // Test phone field. $expected['weight'] = 9; $expected['type'] = 'basic_string'; $expected['settings'] = array(); $component = $display->getComponent('field_test_phone'); - $this->assertEqual($component, $expected, "node.story.teaser field_test_phone is of type telephone."); + $this->assertIdentical($component, $expected, "node.story.teaser field_test_phone is of type telephone."); // Test date field. $expected['weight'] = 10; $expected['type'] = 'datetime_default'; $expected['settings'] = array('format_type' => 'fallback'); $component = $display->getComponent('field_test_date'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); $display = entity_load('entity_view_display', 'node.story.default'); $expected['settings']['format_type'] = 'long'; $component = $display->getComponent('field_test_date'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // Test date stamp field. $expected['weight'] = 11; $expected['settings']['format_type'] = 'fallback'; $component = $display->getComponent('field_test_datestamp'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); $display = entity_load('entity_view_display', 'node.story.teaser'); $expected['settings'] = array('format_type' => 'medium'); $component = $display->getComponent('field_test_datestamp'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // Test datetime field. $expected['weight'] = 12; $expected['settings'] = array('format_type' => 'short'); $component = $display->getComponent('field_test_datetime'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); $display = entity_load('entity_view_display', 'node.story.default'); $expected['settings']['format_type'] = 'fallback'; $component = $display->getComponent('field_test_datetime'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // Test a date field with a random format which should be mapped // to datetime_default. $display = entity_load('entity_view_display', 'node.story.rss'); $expected['settings']['format_type'] = 'fallback'; $component = $display->getComponent('field_test_datetime'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // Test that our Id map has the correct data. $this->assertIdentical(array('node', 'story', 'teaser', 'field_test'), entity_load('migration', 'd6_field_formatter_settings')->getIdMap()->lookupDestinationID(array('story', 'teaser', 'node', 'field_test'))); } diff -u b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php --- b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php @@ -94,14 +94,14 @@ $field = FieldConfig::load('node.story.field_test_two'); $this->assertIdentical($field->label(), 'Integer Field'); $expected = array( - 'min' => '10', - 'max' => '100', + 'min' => 10, + 'max' => 100, 'prefix' => 'pref', 'suffix' => 'suf', - 'unsigned' => '', + 'unsigned' => FALSE, 'size' => 'normal', ); - $this->assertEqual($field->getSettings(), $expected); + $this->assertIdentical($field->getSettings(), $expected); $field = FieldConfig::load('node.story.field_test_four'); $this->assertIdentical($field->label(), 'Float Field'); diff -u b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTest.php --- b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTest.php @@ -55,7 +55,7 @@ $this->assertIdentical($node_revision->getTitle(), 'Test title'); $this->assertIdentical($node_revision->getRevisionAuthor()->id(), '1', 'Node revision has the correct user'); // This is empty on the first revision. - $this->assertEqual($node_revision->revision_log->value, ''); + $this->assertIdentical($node_revision->revision_log->value, ''); // It is pointless to run the second half from MigrateDrupal6Test. if (empty($this->standalone)) { diff -u b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php --- b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php @@ -98,9 +98,9 @@ else { $parents = array(); foreach (taxonomy_term_load_parents($tid) as $parent) { - $parents[] = $parent->id(); + $parents[] = (int) $parent->id(); } - $this->assertEqual($values['parent'], $parents); + $this->assertIdentical($values['parent'], $parents); } } } diff -u b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php --- b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php @@ -158,7 +158,12 @@ $this->assertIdentical($user->label(), $source->name); $this->assertIdentical($user->getEmail(), $source->mail); $this->assertIdentical($user->getSignature(), $source->signature); - $this->assertEqual($user->getSignatureFormat(), reset($signature_format)); + if (reset($signature_format)) { + $this->assertIdentical($user->getSignatureFormat(), reset($signature_format)); + } + else { + $this->assertNull($user->getSignatureFormat()); + } $this->assertIdentical($user->getCreatedTime(), $source->created); $this->assertIdentical($user->getLastAccessedTime(), $source->access); $this->assertIdentical($user->getLastLoginTime(), $source->login); only in patch2: unchanged: --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUrlAliasTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUrlAliasTest.php @@ -46,7 +46,7 @@ public function testUrlAlias() { ); $path = \Drupal::service('path.alias_storage')->load($conditions); $this->assertNotNull($path, "Path alias for node/1 successfully loaded."); - $this->assertEqual(array(1), $migration->getIdMap()->lookupDestinationID(array($path['pid'])), "Test IdMap"); + $this->assertIdentical(array('1'), $migration->getIdMap()->lookupDestinationID(array($path['pid'])), "Test IdMap"); $conditions = array( 'source' => 'node/2', 'alias' => 'alias-two', @@ -70,7 +70,7 @@ public function testUrlAlias() { $executable->import(); $path = \Drupal::service('path.alias_storage')->load(array('pid' => $path['pid'])); - $this->assertEqual($path['alias'], 'new-url-alias'); + $this->assertIdentical($path['alias'], 'new-url-alias'); } }