diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorFeedTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorFeedTest.php index 214b0e8..85ec14a 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorFeedTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorFeedTest.php @@ -41,16 +41,16 @@ public function testAggregatorFeedImport() { /** @var Feed $feed */ $feed = Feed::load(5); $this->assertNotNull($feed->uuid()); - $this->assertEqual($feed->title->value, 'Know Your Meme'); - $this->assertEqual($feed->language()->getId(), 'en'); - $this->assertEqual($feed->url->value, 'http://knowyourmeme.com/newsfeed.rss'); - $this->assertEqual($feed->refresh->value, 900); - $this->assertEqual($feed->checked->value, 1387659487); - $this->assertEqual($feed->queued->value, 0); - $this->assertEqual($feed->link->value, 'http://knowyourmeme.com'); - $this->assertEqual($feed->description->value, 'New items added to the News Feed'); - $this->assertEqual($feed->image->value, 'http://b.thumbs.redditmedia.com/harEHsUUZVajabtC.png'); - $this->assertEqual($feed->etag->value, '"213cc1365b96c310e92053c5551f0504"'); - $this->assertEqual($feed->modified->value, 0); + $this->assertIdentical($feed->title->value, 'Know Your Meme'); + $this->assertIdentical($feed->language()->getId(), 'en'); + $this->assertIdentical($feed->url->value, 'http://knowyourmeme.com/newsfeed.rss'); + $this->assertIdentical($feed->refresh->value, '900'); + $this->assertIdentical($feed->checked->value, '1387659487'); + $this->assertIdentical($feed->queued->value, '0'); + $this->assertIdentical($feed->link->value, 'http://knowyourmeme.com'); + $this->assertIdentical($feed->description->value, 'New items added to the News Feed'); + $this->assertIdentical($feed->image->value, 'http://b.thumbs.redditmedia.com/harEHsUUZVajabtC.png'); + $this->assertIdentical($feed->etag->value, '"213cc1365b96c310e92053c5551f0504"'); + $this->assertIdentical($feed->modified->value, '0'); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php index 672711c..0a8b14f 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php @@ -60,15 +60,15 @@ protected function setUp() { public function testAggregatorItem() { /** @var Item $item */ $item = Item::load(1); - $this->assertEqual($item->id(), 1); - $this->assertEqual($item->getFeedId(), 5); - $this->assertEqual($item->label(), 'This (three) weeks in Drupal Core - January 10th 2014'); - $this->assertEqual($item->getAuthor(), 'larowlan'); - $this->assertEqual($item->getDescription(), "

What's new with Drupal 8?

"); - $this->assertEqual($item->getLink(), 'https://groups.drupal.org/node/395218'); - $this->assertEqual($item->getPostedTime(), 1389297196); - $this->assertEqual($item->language()->getId(), 'en'); - $this->assertEqual($item->getGuid(), '395218 at https://groups.drupal.org'); + $this->assertIdentical($item->id(), '1'); + $this->assertIdentical($item->getFeedId(), '5'); + $this->assertIdentical($item->label(), 'This (three) weeks in Drupal Core - January 10th 2014'); + $this->assertIdentical($item->getAuthor(), 'larowlan'); + $this->assertIdentical($item->getDescription(), "

What's new with Drupal 8?

"); + $this->assertIdentical($item->getLink(), 'https://groups.drupal.org/node/395218'); + $this->assertIdentical($item->getPostedTime(), '1389297196'); + $this->assertIdentical($item->language()->getId(), 'en'); + $this->assertIdentical($item->getGuid(), '395218 at https://groups.drupal.org'); } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockContentTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockContentTest.php index f44346e..bb7ef96 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockContentTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockContentTest.php @@ -56,20 +56,20 @@ protected function setUp() { public function testBlockMigration() { /** @var BlockContent $block */ $block = entity_load('block_content', 1); - $this->assertEqual('My block 1', $block->label()); - $this->assertEqual(1, $block->getRevisionId()); + $this->assertIdentical('My block 1', $block->label()); + $this->assertIdentical('1', $block->getRevisionId()); $this->assertTrue(REQUEST_TIME <= $block->getChangedTime() && $block->getChangedTime() <= time()); - $this->assertEqual('en', $block->language()->getId()); - $this->assertEqual('

My first custom block body

', $block->body->value); - $this->assertEqual('full_html', $block->body->format); + $this->assertIdentical('en', $block->language()->getId()); + $this->assertIdentical('

My first custom block body

', $block->body->value); + $this->assertIdentical('full_html', $block->body->format); $block = entity_load('block_content', 2); - $this->assertEqual('My block 2', $block->label()); - $this->assertEqual(2, $block->getRevisionId()); + $this->assertIdentical('My block 2', $block->label()); + $this->assertIdentical('2', $block->getRevisionId()); $this->assertTrue(REQUEST_TIME <= $block->getChangedTime() && $block->getChangedTime() <= time()); - $this->assertEqual('en', $block->language()->getId()); - $this->assertEqual('

My second custom block body

', $block->body->value); - $this->assertEqual('full_html', $block->body->format); + $this->assertIdentical('en', $block->language()->getId()); + $this->assertIdentical('

My second custom block body

', $block->body->value); + $this->assertIdentical('full_html', $block->body->format); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php index abd0d69..6a250fd 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php @@ -85,74 +85,74 @@ protected function setUp() { */ public function testBlockMigration() { $blocks = Block::loadMultiple(); - $this->assertEqual(count($blocks), 8); + $this->assertIdentical(count($blocks), 8); // User blocks $test_block_user = $blocks['user']; $this->assertNotNull($test_block_user); - $this->assertEqual('sidebar_first', $test_block_user->getRegion()); - $this->assertEqual('bartik', $test_block_user->getTheme()); + $this->assertIdentical('sidebar_first', $test_block_user->getRegion()); + $this->assertIdentical('bartik', $test_block_user->getTheme()); $visibility = $test_block_user->getVisibility(); $this->assertTrue(empty($visibility['request_path']['pages'])); - $this->assertEqual(0, $test_block_user->getWeight()); + $this->assertIdentical(0, $test_block_user->getWeight()); $test_block_user_1 = $blocks['user_1']; $this->assertNotNull($test_block_user_1); - $this->assertEqual('sidebar_first', $test_block_user_1->getRegion()); - $this->assertEqual('bartik', $test_block_user_1->getTheme()); + $this->assertIdentical('sidebar_first', $test_block_user_1->getRegion()); + $this->assertIdentical('bartik', $test_block_user_1->getTheme()); $visibility = $test_block_user_1->getVisibility(); $this->assertTrue(empty($visibility['request_path']['pages'])); - $this->assertEqual(0, $test_block_user_1->getWeight()); + $this->assertIdentical(0, $test_block_user_1->getWeight()); // Check system block $test_block_system = $blocks['system']; $this->assertNotNull($test_block_system); - $this->assertEqual('footer', $test_block_system->getRegion()); - $this->assertEqual('bartik', $test_block_system->getTheme()); + $this->assertIdentical('footer', $test_block_system->getRegion()); + $this->assertIdentical('bartik', $test_block_system->getTheme()); $visibility = $test_block_system->getVisibility(); $this->assertTrue(empty($visibility['request_path']['pages'])); - $this->assertEqual(-5, $test_block_system->getWeight()); + $this->assertIdentical(-5, $test_block_system->getWeight()); // Check menu blocks $test_block_menu = $blocks['menu']; $this->assertNotNull($test_block_menu); - $this->assertEqual('header', $test_block_menu->getRegion()); - $this->assertEqual('bartik', $test_block_menu->getTheme()); + $this->assertIdentical('header', $test_block_menu->getRegion()); + $this->assertIdentical('bartik', $test_block_menu->getTheme()); $visibility = $test_block_menu->getVisibility(); $this->assertTrue(empty($visibility['request_path']['pages'])); - $this->assertEqual(-5, $test_block_menu->getWeight()); + $this->assertIdentical(-5, $test_block_menu->getWeight()); // Check custom blocks $test_block_block = $blocks['block']; $this->assertNotNull($test_block_block); - $this->assertEqual('content', $test_block_block->getRegion()); - $this->assertEqual('bartik', $test_block_block->getTheme()); + $this->assertIdentical('content', $test_block_block->getRegion()); + $this->assertIdentical('bartik', $test_block_block->getTheme()); $visibility = $test_block_block->getVisibility(); - $this->assertEqual($visibility['request_path']['pages'], ''); - $this->assertEqual(0, $test_block_block->getWeight()); + $this->assertIdentical($visibility['request_path']['pages'], ''); + $this->assertIdentical(0, $test_block_block->getWeight()); $test_block_block_1 = $blocks['block_1']; $this->assertNotNull($test_block_block_1); - $this->assertEqual('right', $test_block_block_1->getRegion()); - $this->assertEqual('bluemarine', $test_block_block_1->getTheme()); + $this->assertIdentical('right', $test_block_block_1->getRegion()); + $this->assertIdentical('bluemarine', $test_block_block_1->getTheme()); $visibility = $test_block_block_1->getVisibility(); - $this->assertEqual($visibility['request_path']['pages'], 'node'); - $this->assertEqual(-4, $test_block_block_1->getWeight()); + $this->assertIdentical($visibility['request_path']['pages'], 'node'); + $this->assertIdentical(-4, $test_block_block_1->getWeight()); $test_block_block_2 = $blocks['block_2']; $this->assertNotNull($test_block_block_2); - $this->assertEqual('right', $test_block_block_2->getRegion()); - $this->assertEqual('test_theme', $test_block_block_2->getTheme()); + $this->assertIdentical('right', $test_block_block_2->getRegion()); + $this->assertIdentical('test_theme', $test_block_block_2->getTheme()); $visibility = $test_block_block_2->getVisibility(); $this->assertTrue(empty($visibility['request_path']['pages'])); - $this->assertEqual(-7, $test_block_block_2->getWeight()); + $this->assertIdentical(-7, $test_block_block_2->getWeight()); $test_block_block_3 = $blocks['block_3']; $this->assertNotNull($test_block_block_3); - $this->assertEqual('left', $test_block_block_3->getRegion()); - $this->assertEqual('test_theme', $test_block_block_3->getTheme()); + $this->assertIdentical('left', $test_block_block_3->getRegion()); + $this->assertIdentical('test_theme', $test_block_block_3->getTheme()); $visibility = $test_block_block_3->getVisibility(); $this->assertTrue(empty($visibility['request_path']['pages'])); - $this->assertEqual(-2, $test_block_block_3->getWeight()); + $this->assertIdentical(-2, $test_block_block_3->getWeight()); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBookTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBookTest.php index fe55e14..23e9173 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBookTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBookTest.php @@ -55,26 +55,26 @@ protected function setUp() { */ public function testBook() { $nodes = Node::loadMultiple(array(4, 5, 6, 7, 8)); - $this->assertEqual($nodes[4]->book['bid'], 4); - $this->assertEqual($nodes[4]->book['pid'], 0); + $this->assertIdentical($nodes[4]->book['bid'], '4'); + $this->assertIdentical($nodes[4]->book['pid'], '0'); - $this->assertEqual($nodes[5]->book['bid'], 4); - $this->assertEqual($nodes[5]->book['pid'], 4); + $this->assertIdentical($nodes[5]->book['bid'], '4'); + $this->assertIdentical($nodes[5]->book['pid'], '4'); - $this->assertEqual($nodes[6]->book['bid'], 4); - $this->assertEqual($nodes[6]->book['pid'], 5); + $this->assertIdentical($nodes[6]->book['bid'], '4'); + $this->assertIdentical($nodes[6]->book['pid'], '5'); - $this->assertEqual($nodes[7]->book['bid'], 4); - $this->assertEqual($nodes[7]->book['pid'], 5); + $this->assertIdentical($nodes[7]->book['bid'], '4'); + $this->assertIdentical($nodes[7]->book['pid'], '5'); - $this->assertEqual($nodes[8]->book['bid'], 8); - $this->assertEqual($nodes[8]->book['pid'], 0); + $this->assertIdentical($nodes[8]->book['bid'], '8'); + $this->assertIdentical($nodes[8]->book['pid'], '0'); $tree = \Drupal::service('book.manager')->bookTreeAllData(4); - $this->assertEqual($tree['49990 Node 4 4']['link']['nid'], 4); - $this->assertEqual($tree['49990 Node 4 4']['below']['50000 Node 5 5']['link']['nid'], 5); - $this->assertEqual($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['link']['nid'], 6); - $this->assertEqual($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['link']['nid'], 7); + $this->assertIdentical($tree['49990 Node 4 4']['link']['nid'], '4'); + $this->assertIdentical($tree['49990 Node 4 4']['below']['50000 Node 5 5']['link']['nid'], '5'); + $this->assertIdentical($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['link']['nid'], '6'); + $this->assertIdentical($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['link']['nid'], '7'); $this->assertIdentical($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['below'], array()); $this->assertIdentical($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['below'], array()); } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldRevisionTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldRevisionTest.php index 64b286c..35a73c5 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldRevisionTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldRevisionTest.php @@ -76,8 +76,8 @@ protected function setUp() { */ public function testCckFieldRevision() { $node = \Drupal::entityManager()->getStorage('node')->loadRevision(2); - $this->assertEqual($node->id(), 1, 'Node 1 loaded.'); - $this->assertEqual($node->getRevisionId(), 2, 'Node 1 revision 2loaded.'); + $this->assertIdentical($node->id(), '1', 'Node 1 loaded.'); + $this->assertIdentical($node->getRevisionId(), '2', 'Node 1 revision 2loaded.'); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php index a6485e4..ba604cf 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php @@ -167,16 +167,16 @@ protected function setUp() { public function testCckFields() { $node = Node::load(1); - $this->assertEqual($node->field_test->value, 'This is a shared text field'); - $this->assertEqual($node->field_test->format, 'filtered_html'); - $this->assertEqual($node->field_test_two->value, 10); - $this->assertEqual($node->field_test_two[1]->value, 20); + $this->assertIdentical($node->field_test->value, 'This is a shared text field'); + $this->assertIdentical($node->field_test->format, 'filtered_html'); + $this->assertIdentical($node->field_test_two->value, '10'); + $this->assertIdentical($node->field_test_two[1]->value, '20'); - $this->assertEqual($node->field_test_three->value, '42.42', 'Single field second value is correct.'); - $this->assertEqual($node->field_test_integer_selectlist[0]->value, '3412'); - $this->assertEqual($node->field_test_identical1->value, '1', 'Integer value is correct'); - $this->assertEqual($node->field_test_identical2->value, '1', 'Integer value is correct'); - $this->assertEqual($node->field_test_exclude_unset->value, 'This is a field with exclude unset.', 'Field with exclude unset is correct.'); + $this->assertIdentical($node->field_test_three->value, '42.42', 'Single field second value is correct.'); + $this->assertIdentical($node->field_test_integer_selectlist[0]->value, '3412'); + $this->assertIdentical($node->field_test_identical1->value, '1', 'Integer value is correct'); + $this->assertIdentical($node->field_test_identical2->value, '1', 'Integer value is correct'); + $this->assertIdentical($node->field_test_exclude_unset->value, 'This is a field with exclude unset.', 'Field with exclude unset is correct.'); // Test that link fields are migrated. $this->assertIdentical($node->field_test_link->uri, 'http://drupal.org/project/drupal'); @@ -188,8 +188,8 @@ public function testCckFields() { $this->assertIdentical($node->field_test_filefield->target_id, '5'); $planet_node = Node::load(3); - $this->assertEqual($planet_node->field_multivalue->value, 33); - $this->assertEqual($planet_node->field_multivalue[1]->value, 44); + $this->assertIdentical($planet_node->field_multivalue->value, '33.00'); + $this->assertIdentical($planet_node->field_multivalue[1]->value, '44.00'); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php index c1e9273..e44f31a 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php @@ -75,21 +75,21 @@ protected function setUp() { public function testComments() { /** @var \Drupal\comment\CommentInterface $comment */ $comment = entity_load('comment', 1); - $this->assertEqual('The first comment.', $comment->getSubject()); - $this->assertEqual('The first comment body.', $comment->comment_body->value); - $this->assertEqual('filtered_html', $comment->comment_body->format); - $this->assertEqual(0, $comment->pid->target_id); - $this->assertEqual(1, $comment->getCommentedEntityId()); - $this->assertEqual('node', $comment->getCommentedEntityTypeId()); - $this->assertEqual('en', $comment->language()->getId()); - $this->assertEqual('comment_no_subject', $comment->getTypeId()); + $this->assertIdentical('The first comment.', $comment->getSubject()); + $this->assertIdentical('The first comment body.', $comment->comment_body->value); + $this->assertIdentical('filtered_html', $comment->comment_body->format); + $this->assertIdentical('0', $comment->pid->target_id); + $this->assertIdentical('1', $comment->getCommentedEntityId()); + $this->assertIdentical('node', $comment->getCommentedEntityTypeId()); + $this->assertIdentical('en', $comment->language()->getId()); + $this->assertIdentical('comment_no_subject', $comment->getTypeId()); $comment = entity_load('comment', 2); - $this->assertEqual('The response to the second comment.', $comment->subject->value); - $this->assertEqual(3, $comment->pid->target_id); + $this->assertIdentical('The response to the second comment.', $comment->subject->value); + $this->assertIdentical('3', $comment->pid->target_id); $comment = entity_load('comment', 3); - $this->assertEqual('The second comment.', $comment->subject->value); - $this->assertEqual(0, $comment->pid->target_id); + $this->assertIdentical('The second comment.', $comment->subject->value); + $this->assertIdentical('0', $comment->pid->target_id); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTypeTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTypeTest.php index 45da40b..a056db4 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTypeTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTypeTest.php @@ -42,9 +42,9 @@ protected function setUp() { */ public function testCommentType() { $comment_type = entity_load('comment_type', 'comment'); - $this->assertEqual('node', $comment_type->getTargetEntityTypeId()); + $this->assertIdentical('node', $comment_type->getTargetEntityTypeId()); $comment_type = entity_load('comment_type', 'comment_no_subject'); - $this->assertEqual('node', $comment_type->getTargetEntityTypeId()); + $this->assertIdentical('node', $comment_type->getTargetEntityTypeId()); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityDisplayTest.php index d7f7a5f..0a6a4a8 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityDisplayTest.php @@ -30,9 +30,9 @@ class MigrateCommentVariableEntityDisplayTest extends MigrateCommentVariableDisp public function testCommentEntityDisplay() { foreach ($this->types as $type) { $component = entity_get_display('node', $type, 'default')->getComponent('comment'); - $this->assertEqual($component['label'], 'hidden'); - $this->assertEqual($component['type'], 'comment_default'); - $this->assertEqual($component['weight'], 20); + $this->assertIdentical($component['label'], 'hidden'); + $this->assertIdentical($component['type'], 'comment_default'); + $this->assertIdentical($component['weight'], 20); } } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php index 8d6f970..30bd4cb 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php @@ -60,8 +60,8 @@ protected function setUp() { public function testCommentEntityFormDisplay() { $component = entity_get_form_display('comment', 'comment', 'default') ->getComponent('subject'); - $this->assertEqual($component['type'], 'string_textfield'); - $this->assertEqual($component['weight'], 10); + $this->assertIdentical($component['type'], 'string_textfield'); + $this->assertIdentical($component['weight'], 10); $component = entity_get_form_display('comment', 'comment_no_subject', 'default') ->getComponent('subject'); $this->assertNull($component); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplayTest.php index f0b3dc5..427b375 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplayTest.php @@ -25,8 +25,8 @@ class MigrateCommentVariableEntityFormDisplayTest extends MigrateCommentVariable public function testCommentEntityFormDisplay() { foreach ($this->types as $type) { $component = entity_get_form_display('node', $type, 'default')->getComponent('comment'); - $this->assertEqual($component['type'], 'comment_default'); - $this->assertEqual($component['weight'], 20); + $this->assertIdentical($component['type'], 'comment_default'); + $this->assertIdentical($component['weight'], 20); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php index 9ca6577..5b5b31d 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php @@ -66,24 +66,24 @@ protected function setUp() { */ public function testCommentFieldInstance() { $node = entity_create('node', array('type' => 'page')); - $this->assertEqual($node->comment->status, 0); - $this->assertEqual($node->comment->getFieldDefinition()->getName(), 'comment'); + $this->assertIdentical($node->comment->status, 0); + $this->assertIdentical($node->comment->getFieldDefinition()->getName(), 'comment'); $settings = $node->comment->getFieldDefinition()->getSettings(); - $this->assertEqual($settings['default_mode'], 4); - $this->assertEqual($settings['per_page'], 50); - $this->assertEqual($settings['anonymous'], 0); - $this->assertEqual($settings['form_location'], 0); - $this->assertEqual($settings['preview'], 1); + $this->assertIdentical($settings['default_mode'], 4); + $this->assertIdentical($settings['per_page'], 50); + $this->assertIdentical($settings['anonymous'], 0); + $this->assertIdentical($settings['form_location'], FALSE); + $this->assertIdentical($settings['preview'], 1); $node = entity_create('node', array('type' => 'story')); - $this->assertEqual($node->comment_no_subject->status, 2); - $this->assertEqual($node->comment_no_subject->getFieldDefinition()->getName(), 'comment_no_subject'); + $this->assertIdentical($node->comment_no_subject->status, 2); + $this->assertIdentical($node->comment_no_subject->getFieldDefinition()->getName(), 'comment_no_subject'); $settings = $node->comment_no_subject->getFieldDefinition()->getSettings(); - $this->assertEqual($settings['default_mode'], 2); - $this->assertEqual($settings['per_page'], 70); - $this->assertEqual($settings['anonymous'], 1); - $this->assertEqual($settings['form_location'], 0); - $this->assertEqual($settings['preview'], 0); + $this->assertIdentical($settings['default_mode'], 2); + $this->assertIdentical($settings['per_page'], 70); + $this->assertIdentical($settings['anonymous'], 1); + $this->assertIdentical($settings['form_location'], FALSE); + $this->assertIdentical($settings['preview'], 0); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateContactCategoryTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateContactCategoryTest.php index 3d690d9..2655306 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateContactCategoryTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateContactCategoryTest.php @@ -46,22 +46,22 @@ protected function setUp() { public function testContactCategory() { /** @var \Drupal\contact\Entity\ContactForm $contact_form */ $contact_form = ContactForm::load('website_feedback'); - $this->assertEqual($contact_form->label(), 'Website feedback'); - $this->assertEqual($contact_form->getRecipients(), array('admin@example.com')); - $this->assertEqual($contact_form->getReply(), ''); - $this->assertEqual($contact_form->getWeight(), 0); + $this->assertIdentical($contact_form->label(), 'Website feedback'); + $this->assertIdentical($contact_form->getRecipients(), array('admin@example.com')); + $this->assertIdentical($contact_form->getReply(), ''); + $this->assertIdentical($contact_form->getWeight(), 0); $contact_form = ContactForm::load('some_other_category'); - $this->assertEqual($contact_form->label(), 'Some other category'); - $this->assertEqual($contact_form->getRecipients(), array('test@example.com')); - $this->assertEqual($contact_form->getReply(), 'Thanks for contacting us, we will reply ASAP!'); - $this->assertEqual($contact_form->getWeight(), 1); + $this->assertIdentical($contact_form->label(), 'Some other category'); + $this->assertIdentical($contact_form->getRecipients(), array('test@example.com')); + $this->assertIdentical($contact_form->getReply(), 'Thanks for contacting us, we will reply ASAP!'); + $this->assertIdentical($contact_form->getWeight(), 1); $contact_form = ContactForm::load('a_category_much_longer_than_thir'); - $this->assertEqual($contact_form->label(), 'A category much longer than thirty two characters'); - $this->assertEqual($contact_form->getRecipients(), array('fortyninechars@example.com')); - $this->assertEqual($contact_form->getReply(), ''); - $this->assertEqual($contact_form->getWeight(), 2); + $this->assertIdentical($contact_form->label(), 'A category much longer than thirty two characters'); + $this->assertIdentical($contact_form->getRecipients(), array('fortyninechars@example.com')); + $this->assertIdentical($contact_form->getReply(), ''); + $this->assertIdentical($contact_form->getWeight(), 2); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php index b1c967e..0bd3d1c 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php @@ -35,13 +35,13 @@ protected function setUp() { */ public function testDateFormats() { $short_date_format = entity_load('date_format', 'short'); - $this->assertEqual('\S\H\O\R\T m/d/Y - H:i', $short_date_format->getPattern()); + $this->assertIdentical('\S\H\O\R\T m/d/Y - H:i', $short_date_format->getPattern()); $medium_date_format = entity_load('date_format', 'medium'); - $this->assertEqual('\M\E\D\I\U\M D, m/d/Y - H:i', $medium_date_format->getPattern()); + $this->assertIdentical('\M\E\D\I\U\M D, m/d/Y - H:i', $medium_date_format->getPattern()); $long_date_format = entity_load('date_format', 'long'); - $this->assertEqual('\L\O\N\G l, F j, Y - H:i', $long_date_format->getPattern()); + $this->assertIdentical('\L\O\N\G l, F j, Y - H:i', $long_date_format->getPattern()); // Test that we can re-import using the EntityDateFormat destination. Database::getConnection('default', 'migrate') @@ -55,7 +55,7 @@ public function testDateFormats() { $executable->import(); $short_date_format = entity_load('date_format', 'short'); - $this->assertEqual('\S\H\O\R\T d/m/Y - H:i', $short_date_format->getPattern()); + $this->assertIdentical('\S\H\O\R\T d/m/Y - H:i', $short_date_format->getPattern()); } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php index 99520a3..71f3e0f 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php @@ -84,8 +84,8 @@ public function testEntityDisplaySettings() { // 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(), @@ -93,23 +93,23 @@ public function testEntityDisplaySettings() { // 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'); $expected['weight'] = 35; - $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'); $expected['weight'] = 1; - $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'); @@ -127,107 +127,111 @@ public function testEntityDisplaySettings() { 'prefix_suffix' => TRUE, ); $component = $display->getComponent('field_test_two'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); $expected['weight'] = 2; $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'] = 6; $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'] = 7; $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); - $expected['settings']['url_only'] = 0; - $expected['settings']['url_plain'] = 0; + $this->assertIdentical($component, $expected); + $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); + $this->assertIdentical($component, $expected); // Test the file field formatter settings. $expected['weight'] = 8; $expected['type'] = 'file_default'; $expected['settings'] = array(); $component = $display->getComponent('field_test_filefield'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); $display = entity_load('entity_view_display', 'node.story.default'); $expected['type'] = 'file_url_plain'; $component = $display->getComponent('field_test_filefield'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // Test the image field formatter settings. $expected['weight'] = 9; $expected['type'] = 'image'; $expected['settings'] = array('image_style' => '', 'image_link' => ''); $component = $display->getComponent('field_test_imagefield'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); $display = entity_load('entity_view_display', 'node.story.teaser'); $expected['settings']['image_link'] = 'file'; $component = $display->getComponent('field_test_imagefield'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // Test phone field. $expected['weight'] = 13; $expected['type'] = 'basic_string'; $expected['settings'] = array(); $component = $display->getComponent('field_test_phone'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // 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->assertEqual(array('node', 'story', 'teaser', 'field_test'), entity_load('migration', 'd6_field_formatter_settings')->getIdMap()->lookupDestinationID(array('story', 'teaser', 'node', 'field_test'))); + $this->assertIdentical(array('node', 'story', 'teaser', 'field_test'), entity_load('migration', 'd6_field_formatter_settings')->getIdMap()->lookupDestinationID(array('story', 'teaser', 'node', 'field_test'))); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php index dc4d2c8..cf75770 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php @@ -89,42 +89,42 @@ public function testFieldInstanceSettings() { $entity = entity_create('node', array('type' => 'story')); // Test a text field. $field = FieldConfig::load('node.story.field_test'); - $this->assertEqual($field->label(), 'Text Field'); + $this->assertIdentical($field->label(), 'Text Field'); $expected = array('max_length' => 255); - $this->assertEqual($field->getSettings(), $expected); - $this->assertEqual('text for default value', $entity->field_test->value); + $this->assertIdentical($field->getSettings(), $expected); + $this->assertIdentical('text for default value', $entity->field_test->value); // Test a number field. $field = FieldConfig::load('node.story.field_test_two'); - $this->assertEqual($field->label(), 'Integer Field'); + $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->assertEqual($field->label(), 'Float Field'); + $this->assertIdentical($field->label(), 'Float Field'); $expected = array( - 'min' => 100, - 'max' => 200, + 'min' => 100.0, + 'max' => 200.0, 'prefix' => 'id-', 'suffix' => '', ); - $this->assertEqual($field->getSettings(), $expected); + $this->assertIdentical($field->getSettings(), $expected); // Test email field. $field = FieldConfig::load('node.story.field_test_email'); - $this->assertEqual($field->label(), 'Email Field'); - $this->assertEqual('benjy@example.com', $entity->field_test_email->value); + $this->assertIdentical($field->label(), 'Email Field'); + $this->assertIdentical('benjy@example.com', $entity->field_test_email->value); // Test a filefield. $field = FieldConfig::load('node.story.field_test_filefield'); - $this->assertEqual($field->label(), 'File Field'); + $this->assertIdentical($field->label(), 'File Field'); $expected = array( 'file_extensions' => 'txt pdf doc', 'file_directory' => 'images', @@ -143,11 +143,11 @@ public function testFieldInstanceSettings() { // Test a link field. $field = FieldConfig::load('node.story.field_test_link'); - $this->assertEqual($field->label(), 'Link Field'); + $this->assertIdentical($field->label(), 'Link Field'); $expected = array('title' => 2, 'link_type' => LinkItemInterface::LINK_GENERIC); - $this->assertEqual($field->getSettings(), $expected); - $this->assertEqual('default link title', $entity->field_test_link->title, 'Field field_test_link default title is correct.'); - $this->assertEqual('http://drupal.org', $entity->field_test_link->url, 'Field field_test_link default title is correct.'); + $this->assertIdentical($field->getSettings(), $expected); + $this->assertIdentical('default link title', $entity->field_test_link->title, 'Field field_test_link default title is correct.'); + $this->assertIdentical('http://drupal.org', $entity->field_test_link->url, 'Field field_test_link default title is correct.'); $this->assertIdentical($entity->field_test_link->options['attributes'], []); } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php index d2ca2ad..296ae36 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php @@ -52,68 +52,67 @@ public function testFields() { /** @var \Drupal\field\Entity\FieldStorageConfig $field_storage */ $field_storage = FieldStorageConfig::load('node.field_test'); $expected = array('max_length' => 255); - $this->assertEqual($field_storage->type, "text", t('Field type is @fieldtype. It should be text.', array('@fieldtype' => $field_storage->type))); - $this->assertEqual($field_storage->settings, $expected, "Field type text settings are correct"); + $this->assertIdentical($field_storage->type, "text", t('Field type is @fieldtype. It should be text.', array('@fieldtype' => $field_storage->type))); + $this->assertIdentical($field_storage->settings, $expected, "Field type text settings are correct"); // Integer field. $field_storage = FieldStorageConfig::load('node.field_test_two'); - $this->assertEqual($field_storage->type, "integer", t('Field type is @fieldtype. It should be integer.', array('@fieldtype' => $field_storage->type))); + $this->assertIdentical($field_storage->type, "integer", t('Field type is @fieldtype. It should be integer.', array('@fieldtype' => $field_storage->type))); // Float field. $field_storage = FieldStorageConfig::load('node.field_test_three'); - $this->assertEqual($field_storage->type, "decimal", t('Field type is @fieldtype. It should be decimal.', array('@fieldtype' => $field_storage->type))); + $this->assertIdentical($field_storage->type, "decimal", t('Field type is @fieldtype. It should be decimal.', array('@fieldtype' => $field_storage->type))); // Link field. $field_storage = FieldStorageConfig::load('node.field_test_link'); - $this->assertEqual($field_storage->type, "link", t('Field type is @fieldtype. It should be link.', array('@fieldtype' => $field_storage->type))); + $this->assertIdentical($field_storage->type, "link", t('Field type is @fieldtype. It should be link.', array('@fieldtype' => $field_storage->type))); // File field. $field_storage = FieldStorageConfig::load('node.field_test_filefield'); - $this->assertEqual($field_storage->type, "file", t('Field type is @fieldtype. It should be file.', array('@fieldtype' => $field_storage->type))); + $this->assertIdentical($field_storage->type, "file", t('Field type is @fieldtype. It should be file.', array('@fieldtype' => $field_storage->type))); $field_storage = FieldStorageConfig::load('node.field_test_imagefield'); - $this->assertEqual($field_storage->type, "image", t('Field type is @fieldtype. It should be image.', array('@fieldtype' => $field_storage->type))); + $this->assertIdentical($field_storage->type, "image", t('Field type is @fieldtype. It should be image.', array('@fieldtype' => $field_storage->type))); $settings = $field_storage->getSettings(); - $this->assertEqual($settings['target_type'], 'file'); - $this->assertEqual($settings['uri_scheme'], 'public'); - $this->assertEqual($settings['default_image']['uuid'], ''); - $this->assertEqual(array_filter($settings['default_image']), array()); + $this->assertIdentical($settings['target_type'], 'file'); + $this->assertIdentical($settings['uri_scheme'], 'public'); + $this->assertIdentical(array_filter($settings['default_image']), array()); // Phone field. $field_storage = FieldStorageConfig::load('node.field_test_phone'); - $this->assertEqual($field_storage->type, "telephone", t('Field type is @fieldtype. It should be telephone.', array('@fieldtype' => $field_storage->type))); + $this->assertIdentical($field_storage->type, "telephone", t('Field type is @fieldtype. It should be telephone.', array('@fieldtype' => $field_storage->type))); // Date field. $field_storage = FieldStorageConfig::load('node.field_test_datetime'); - $this->assertEqual($field_storage->type, "datetime", t('Field type is @fieldtype. It should be datetime.', array('@fieldtype' => $field_storage->type))); + $this->assertIdentical($field_storage->type, "datetime", t('Field type is @fieldtype. It should be datetime.', array('@fieldtype' => $field_storage->type))); // Decimal field with radio buttons. $field_storage = FieldStorageConfig::load('node.field_test_decimal_radio_buttons'); - $this->assertEqual($field_storage->type, "list_float", t('Field type is @fieldtype. It should be list_float.', array('@fieldtype' => $field_storage->type))); + $this->assertIdentical($field_storage->type, "list_float", t('Field type is @fieldtype. It should be list_float.', array('@fieldtype' => $field_storage->type))); $this->assertNotNull($field_storage->settings['allowed_values']['1.2'], t('First allowed value key is set to 1.2')); $this->assertNotNull($field_storage->settings['allowed_values']['2.1'], t('Second allowed value key is set to 2.1')); - $this->assertEqual($field_storage->settings['allowed_values']['1.2'], '1.2', t('First allowed value is set to 1.2')); - $this->assertEqual($field_storage->settings['allowed_values']['2.1'], '2.1', t('Second allowed value is set to 1.2')); + $this->assertIdentical($field_storage->settings['allowed_values']['1.2'], '1.2', t('First allowed value is set to 1.2')); + $this->assertIdentical($field_storage->settings['allowed_values']['2.1'], '2.1', t('Second allowed value is set to 1.2')); // Float field with a single checkbox. $field_storage = FieldStorageConfig::load('node.field_test_float_single_checkbox'); - $this->assertEqual($field_storage->type, "boolean", t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->type))); + $this->assertIdentical($field_storage->type, "boolean", t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->type))); // Integer field with a select list. $field_storage = FieldStorageConfig::load('node.field_test_integer_selectlist'); - $this->assertEqual($field_storage->type, "list_integer", t('Field type is @fieldtype. It should be list_integer.', array('@fieldtype' => $field_storage->type))); + $this->assertIdentical($field_storage->type, "list_integer", t('Field type is @fieldtype. It should be list_integer.', array('@fieldtype' => $field_storage->type))); $this->assertNotNull($field_storage->settings['allowed_values']['1234'], t('First allowed value key is set to 1234')); $this->assertNotNull($field_storage->settings['allowed_values']['2341'], t('Second allowed value key is set to 2341')); $this->assertNotNull($field_storage->settings['allowed_values']['3412'], t('Third allowed value key is set to 3412')); $this->assertNotNull($field_storage->settings['allowed_values']['4123'], t('Fourth allowed value key is set to 4123')); - $this->assertEqual($field_storage->settings['allowed_values']['1234'], '1234', t('First allowed value is set to 1234')); - $this->assertEqual($field_storage->settings['allowed_values']['2341'], '2341', t('Second allowed value is set to 2341')); - $this->assertEqual($field_storage->settings['allowed_values']['3412'], '3412', t('Third allowed value is set to 3412')); - $this->assertEqual($field_storage->settings['allowed_values']['4123'], '4123', t('Fourth allowed value is set to 4123')); + $this->assertIdentical($field_storage->settings['allowed_values']['1234'], '1234', t('First allowed value is set to 1234')); + $this->assertIdentical($field_storage->settings['allowed_values']['2341'], '2341', t('Second allowed value is set to 2341')); + $this->assertIdentical($field_storage->settings['allowed_values']['3412'], '3412', t('Third allowed value is set to 3412')); + $this->assertIdentical($field_storage->settings['allowed_values']['4123'], '4123', t('Fourth allowed value is set to 4123')); // Text field with a single checkbox. $field_storage = FieldStorageConfig::load('node.field_test_text_single_checkbox'); - $this->assertEqual($field_storage->type, "boolean", t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->type))); + $this->assertIdentical($field_storage->type, "boolean", t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->type))); } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldWidgetSettingsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldWidgetSettingsTest.php index d9346b3..25612c2 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldWidgetSettingsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldWidgetSettingsTest.php @@ -81,37 +81,37 @@ protected function setUp() { public function testWidgetSettings() { // Test the config can be loaded. $form_display = entity_load('entity_form_display', 'node.story.default'); - $this->assertEqual(is_null($form_display), FALSE, "Form display node.story.default loaded with config."); + $this->assertIdentical(is_null($form_display), FALSE, "Form display node.story.default loaded with config."); // Text field. $component = $form_display->getComponent('field_test'); $expected = array('weight' => 1, 'type' => 'text_textfield'); $expected['settings'] = array('size' => 60, 'placeholder' => ''); $expected['third_party_settings'] = array(); - $this->assertEqual($component, $expected, 'Text field settings are correct.'); + $this->assertIdentical($component, $expected, 'Text field settings are correct.'); // Integer field. $component = $form_display->getComponent('field_test_two'); $expected['type'] = 'number'; $expected['weight'] = 1; $expected['settings'] = array('placeholder' => ''); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // Float field. $component = $form_display->getComponent('field_test_three'); $expected['weight'] = 2; - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // Email field. $component = $form_display->getComponent('field_test_email'); $expected['type'] = 'email_default'; $expected['weight'] = 6; - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // Link field. $component = $form_display->getComponent('field_test_link'); - $this->assertEqual($component['type'], 'link_default'); - $this->assertEqual($component['weight'], 7); + $this->assertIdentical($component['type'], 'link_default'); + $this->assertIdentical($component['weight'], 7); $this->assertFalse(array_filter($component['settings'])); // File field. @@ -119,36 +119,36 @@ public function testWidgetSettings() { $expected['type'] = 'file_generic'; $expected['weight'] = 8; $expected['settings'] = array('progress_indicator' => 'bar'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // Image field. $component = $form_display->getComponent('field_test_imagefield'); $expected['type'] = 'image_image'; $expected['weight'] = 9; $expected['settings'] = array('progress_indicator' => 'bar', 'preview_image_style' => 'thumbnail'); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // Phone field. $component = $form_display->getComponent('field_test_phone'); $expected['type'] = 'telephone_default'; $expected['weight'] = 13; $expected['settings'] = array('placeholder' => ''); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); // Date fields. $component = $form_display->getComponent('field_test_date'); $expected['type'] = 'datetime_default'; $expected['weight'] = 10; $expected['settings'] = array(); - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); $component = $form_display->getComponent('field_test_datestamp'); $expected['weight'] = 11; - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); $component = $form_display->getComponent('field_test_datetime'); $expected['weight'] = 12; - $this->assertEqual($component, $expected); + $this->assertIdentical($component, $expected); } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php index 9799c5c..acbcd24 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php @@ -54,10 +54,10 @@ protected function setUp() { public function testFiles() { /** @var \Drupal\file\FileInterface $file */ $file = entity_load('file', 1); - $this->assertEqual($file->getFilename(), 'Image1.png'); - $this->assertEqual($file->getSize(), 39325); - $this->assertEqual($file->getFileUri(), 'public://image-1.png'); - $this->assertEqual($file->getMimeType(), 'image/png'); + $this->assertIdentical($file->getFilename(), 'Image1.png'); + $this->assertIdentical($file->getSize(), '39325'); + $this->assertIdentical($file->getFileUri(), 'public://image-1.png'); + $this->assertIdentical($file->getMimeType(), 'image/png'); // It is pointless to run the second half from MigrateDrupal6Test. if (empty($this->standalone)) { return; @@ -86,7 +86,7 @@ public function testFiles() { $executable->import(); $file = entity_load('file', 2); - $this->assertEqual($file->getFileUri(), 'public://core/modules/simpletest/files/image-2.jpg'); + $this->assertIdentical($file->getFileUri(), 'public://core/modules/simpletest/files/image-2.jpg'); // Ensure that a temporary file has been migrated. $file = entity_load('file', 6); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php index fc89648..5522673 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php @@ -39,9 +39,9 @@ protected function setUp() { */ public function testMenu() { $navigation_menu = Menu::load('navigation'); - $this->assertEqual($navigation_menu->id(), 'navigation'); - $this->assertEqual($navigation_menu->label(), 'Navigation'); - $this->assertEqual($navigation_menu->getDescription() , 'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.'); + $this->assertIdentical($navigation_menu->id(), 'navigation'); + $this->assertIdentical($navigation_menu->label(), 'Navigation'); + $this->assertIdentical($navigation_menu->getDescription() , 'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.'); // Test that we can re-import using the ConfigEntityBase destination. Database::getConnection('default', 'migrate') @@ -56,7 +56,7 @@ public function testMenu() { $executable->import(); $navigation_menu = entity_load_unchanged('menu', 'navigation'); - $this->assertEqual($navigation_menu->label(), 'Home Navigation'); + $this->assertIdentical($navigation_menu->label(), 'Home Navigation'); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeBundleSettingsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeBundleSettingsTest.php index 503780c..2306cbf 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeBundleSettingsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeBundleSettingsTest.php @@ -86,21 +86,21 @@ public function testNodeBundleSettings() { // Test settings on test_page bundle. $node = entity_create('node', array('type' => 'test_page')); - $this->assertEqual($node->status->value, TRUE); - $this->assertEqual($node->promote->value, TRUE); - $this->assertEqual($node->sticky->value, TRUE); + $this->assertIdentical($node->status->value, 1); + $this->assertIdentical($node->promote->value, 1); + $this->assertIdentical($node->sticky->value, 1); // Test settings for test_story bundle. $node = entity_create('node', array('type' => 'test_story')); - $this->assertEqual($node->status->value, TRUE); - $this->assertEqual($node->promote->value, TRUE); - $this->assertEqual($node->sticky->value, FALSE); + $this->assertIdentical($node->status->value, 1); + $this->assertIdentical($node->promote->value, 1); + $this->assertIdentical($node->sticky->value, 0); // Test settings for the test_event bundle. $node = entity_create('node', array('type' => 'test_event')); - $this->assertEqual($node->status->value, FALSE); - $this->assertEqual($node->promote->value, FALSE); - $this->assertEqual($node->sticky->value, TRUE); + $this->assertIdentical($node->status->value, 0); + $this->assertIdentical($node->promote->value, 0); + $this->assertIdentical($node->sticky->value, 1); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeRevisionTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeRevisionTest.php index c16044a..d5aa3b3 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeRevisionTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeRevisionTest.php @@ -55,22 +55,22 @@ protected function setUp() { public function testNodeRevision() { $node = \Drupal::entityManager()->getStorage('node')->loadRevision(2); /** @var \Drupal\node\NodeInterface $node */ - $this->assertEqual($node->id(), 1); - $this->assertEqual($node->getRevisionId(), 2); - $this->assertEqual($node->langcode->value, 'und'); - $this->assertEqual($node->getTitle(), 'Test title rev 2'); - $this->assertEqual($node->body->value, 'body test rev 2'); - $this->assertEqual($node->body->summary, 'teaser test rev 2'); - $this->assertEqual($node->getRevisionAuthor()->id(), 2); - $this->assertEqual($node->revision_log->value, 'modified rev 2'); - $this->assertEqual($node->getRevisionCreationTime(), '1390095702'); + $this->assertIdentical($node->id(), '1'); + $this->assertIdentical($node->getRevisionId(), '2'); + $this->assertIdentical($node->langcode->value, 'und'); + $this->assertIdentical($node->getTitle(), 'Test title rev 2'); + $this->assertIdentical($node->body->value, 'body test rev 2'); + $this->assertIdentical($node->body->summary, 'teaser test rev 2'); + $this->assertIdentical($node->getRevisionAuthor()->id(), '2'); + $this->assertIdentical($node->revision_log->value, 'modified rev 2'); + $this->assertIdentical($node->getRevisionCreationTime(), '1390095702'); $node = \Drupal::entityManager()->getStorage('node')->loadRevision(5); - $this->assertEqual($node->id(), 1); - $this->assertEqual($node->body->value, 'body test rev 3'); - $this->assertEqual($node->getRevisionAuthor()->id(), 1); - $this->assertEqual($node->revision_log->value, 'modified rev 3'); - $this->assertEqual($node->getRevisionCreationTime(), '1390095703'); + $this->assertIdentical($node->id(), '1'); + $this->assertIdentical($node->body->value, 'body test rev 3'); + $this->assertIdentical($node->getRevisionAuthor()->id(), '1'); + $this->assertIdentical($node->revision_log->value, 'modified rev 3'); + $this->assertIdentical($node->getRevisionCreationTime(), '1390095703'); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTest.php index d682bab..6da7ab0 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTest.php @@ -38,24 +38,24 @@ protected function setUp() { */ public function testNode() { $node = Node::load(1); - $this->assertEqual($node->id(), 1, 'Node 1 loaded.'); - $this->assertEqual($node->langcode->value, 'und'); - $this->assertEqual($node->body->value, 'test'); - $this->assertEqual($node->body->summary, 'test'); - $this->assertEqual($node->body->format, 'filtered_html'); - $this->assertEqual($node->getType(), 'story', 'Node has the correct bundle.'); - $this->assertEqual($node->getTitle(), 'Test title', 'Node has the correct title.'); - $this->assertEqual($node->getCreatedTime(), 1388271197, 'Node has the correct created time.'); - $this->assertEqual($node->isSticky(), FALSE); - $this->assertEqual($node->getOwnerId(), 1); - $this->assertEqual($node->getRevisionCreationTime(), 1420861423); + $this->assertIdentical($node->id(), '1', 'Node 1 loaded.'); + $this->assertIdentical($node->langcode->value, 'und'); + $this->assertIdentical($node->body->value, 'test'); + $this->assertIdentical($node->body->summary, 'test'); + $this->assertIdentical($node->body->format, 'filtered_html'); + $this->assertIdentical($node->getType(), 'story', 'Node has the correct bundle.'); + $this->assertIdentical($node->getTitle(), 'Test title', 'Node has the correct title.'); + $this->assertIdentical($node->getCreatedTime(), '1388271197', 'Node has the correct created time.'); + $this->assertIdentical($node->isSticky(), FALSE); + $this->assertIdentical($node->getOwnerId(), '1'); + $this->assertIdentical($node->getRevisionCreationTime(), '1420861423'); /** @var \Drupal\node\NodeInterface $node_revision */ $node_revision = \Drupal::entityManager()->getStorage('node')->loadRevision(1); - $this->assertEqual($node_revision->getTitle(), 'Test title'); - $this->assertEqual($node_revision->getRevisionAuthor()->id(), 1, 'Node revision has the correct user'); + $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)) { @@ -81,10 +81,10 @@ public function testNode() { $executable->import(); $node = Node::load(1); - $this->assertEqual($node->getTitle(), 'New node title'); + $this->assertIdentical($node->getTitle(), 'New node title'); // Test a multi-column fields are correctly upgraded. - $this->assertEqual($node->body->value, 'test'); - $this->assertEqual($node->body->format, 'full_html'); + $this->assertIdentical($node->body->value, 'test'); + $this->assertIdentical($node->body->format, 'full_html'); $node = Node::load(3); // Test that format = 0 from source maps to filtered_html. diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTestBase.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTestBase.php index 20343a6..30bbae7 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTestBase.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTestBase.php @@ -64,6 +64,7 @@ protected function setUp() { 'type' => 'story', 'nid' => 1, 'vid' => 1, + 'revision_log' => '', )); $node->enforceIsNew(); $node->save(); @@ -72,6 +73,7 @@ protected function setUp() { 'type' => 'test_planet', 'nid' => 3, 'vid' => 4, + 'revision_log' => '', )); $node->enforceIsNew(); $node->save(); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php index 809bc4f..c90d1f1 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php @@ -47,42 +47,42 @@ public function testNodeType() { $migration = entity_load('migration', 'd6_node_type'); // Test the test_page content type. $node_type_page = entity_load('node_type', 'test_page'); - $this->assertEqual($node_type_page->id(), 'test_page', 'Node type test_page loaded'); + $this->assertIdentical($node_type_page->id(), 'test_page', 'Node type test_page loaded'); - $this->assertEqual($node_type_page->displaySubmitted(), TRUE); - $this->assertEqual($node_type_page->isNewRevision(), FALSE); - $this->assertEqual($node_type_page->getPreviewMode(), DRUPAL_OPTIONAL); - $this->assertEqual(array('test_page'), $migration->getIdMap()->lookupDestinationID(array('test_page'))); + $this->assertIdentical($node_type_page->displaySubmitted(), TRUE); + $this->assertIdentical($node_type_page->isNewRevision(), FALSE); + $this->assertIdentical($node_type_page->getPreviewMode(), DRUPAL_OPTIONAL); + $this->assertIdentical(array('test_page'), $migration->getIdMap()->lookupDestinationID(array('test_page'))); // Test we have a body field. $field = FieldConfig::loadByName('node', 'test_page', 'body'); - $this->assertEqual($field->getLabel(), 'This is the body field label', 'Body field was found.'); + $this->assertIdentical($field->getLabel(), 'This is the body field label', 'Body field was found.'); // Test the test_story content type. $node_type_story = entity_load('node_type', 'test_story'); - $this->assertEqual($node_type_story->id(), 'test_story', 'Node type test_story loaded'); + $this->assertIdentical($node_type_story->id(), 'test_story', 'Node type test_story loaded'); - $this->assertEqual($node_type_story->displaySubmitted(), TRUE); - $this->assertEqual($node_type_story->isNewRevision(), FALSE); - $this->assertEqual($node_type_story->getPreviewMode(), DRUPAL_OPTIONAL); - $this->assertEqual(array('test_story'), $migration->getIdMap()->lookupDestinationID(array('test_story'))); + $this->assertIdentical($node_type_story->displaySubmitted(), TRUE); + $this->assertIdentical($node_type_story->isNewRevision(), FALSE); + $this->assertIdentical($node_type_story->getPreviewMode(), DRUPAL_OPTIONAL); + $this->assertIdentical(array('test_story'), $migration->getIdMap()->lookupDestinationID(array('test_story'))); // Test we don't have a body field. $field = FieldConfig::loadByName('node', 'test_story', 'body'); - $this->assertEqual($field, NULL, 'No body field found'); + $this->assertIdentical($field, NULL, 'No body field found'); // Test the test_event content type. $node_type_event = entity_load('node_type', 'test_event'); - $this->assertEqual($node_type_event->id(), 'test_event', 'Node type test_event loaded'); + $this->assertIdentical($node_type_event->id(), 'test_event', 'Node type test_event loaded'); - $this->assertEqual($node_type_event->displaySubmitted(), TRUE); - $this->assertEqual($node_type_event->isNewRevision(), TRUE); - $this->assertEqual($node_type_event->getPreviewMode(), DRUPAL_OPTIONAL); - $this->assertEqual(array('test_event'), $migration->getIdMap()->lookupDestinationID(array('test_event'))); + $this->assertIdentical($node_type_event->displaySubmitted(), TRUE); + $this->assertIdentical($node_type_event->isNewRevision(), TRUE); + $this->assertIdentical($node_type_event->getPreviewMode(), DRUPAL_OPTIONAL); + $this->assertIdentical(array('test_event'), $migration->getIdMap()->lookupDestinationID(array('test_event'))); // Test we have a body field. $field = FieldConfig::loadByName('node', 'test_event', 'body'); - $this->assertEqual($field->getLabel(), 'Body', 'Body field was found.'); + $this->assertIdentical($field->getLabel(), 'Body', 'Body field was found.'); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchPageTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchPageTest.php index c17876b..59bce29 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchPageTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchPageTest.php @@ -47,15 +47,15 @@ public function testSearchPage() { $id = 'node_search'; /** @var \Drupal\search\Entity\SearchPage $search_page */ $search_page = entity_load('search_page', $id); - $this->assertEqual($search_page->id(), $id); + $this->assertIdentical($search_page->id(), $id); $configuration = $search_page->getPlugin()->getConfiguration(); - $this->assertEqual($configuration['rankings'], array( + $this->assertIdentical($configuration['rankings'], array( 'comments' => 5, 'relevance' => 2, 'sticky' => 8, 'views' => 1, )); - $this->assertEqual($search_page->getPath(), 'node'); + $this->assertIdentical($search_page->getPath(), 'node'); // Test that we can re-import using the EntitySearchPage destination. Database::getConnection('default', 'migrate') @@ -70,7 +70,7 @@ public function testSearchPage() { $search_page = entity_load('search_page', $id); $configuration = $search_page->getPlugin()->getConfiguration(); - $this->assertEqual($configuration['rankings']['comments'], 4); + $this->assertIdentical($configuration['rankings']['comments'], 4); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php index 9e8b315..08c6e09 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php @@ -92,17 +92,17 @@ public function testTaxonomyTerms() { $term = $terms[$tid]; $this->assertIdentical($term->name->value, "term {$tid} of vocabulary {$values['source_vid']}"); $this->assertIdentical($term->description->value, "description of term {$tid} of vocabulary {$values['source_vid']}"); - $this->assertEqual($term->vid->target_id, $values['vid']); - $this->assertEqual($term->weight->value, $values['weight']); + $this->assertIdentical($term->vid->target_id, $values['vid']); + $this->assertIdentical($term->weight->value, (string) $values['weight']); if ($values['parent'] === array(0)) { - $this->assertEqual($term->parent->target_id, 0); + $this->assertNull($term->parent->target_id); } 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 --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php index ff3c3f2..4764dad 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php @@ -47,17 +47,17 @@ public function testTaxonomyVocabulary() { for ($i = 0; $i < 3; $i++) { $j = $i + 1; $vocabulary = Vocabulary::load("vocabulary_{$j}_i_{$i}_"); - $this->assertEqual(array($vocabulary->id()), entity_load('migration', 'd6_taxonomy_vocabulary')->getIdMap()->lookupDestinationID(array($j))); - $this->assertEqual($vocabulary->label(), "vocabulary $j (i=$i)"); - $this->assertEqual($vocabulary->getDescription(), "description of vocabulary $j (i=$i)"); - $this->assertEqual($vocabulary->getHierarchy(), $i); - $this->assertEqual($vocabulary->get('weight'), 4 + $i); + $this->assertIdentical(array($vocabulary->id()), entity_load('migration', 'd6_taxonomy_vocabulary')->getIdMap()->lookupDestinationID(array($j))); + $this->assertIdentical($vocabulary->label(), "vocabulary $j (i=$i)"); + $this->assertIdentical($vocabulary->getDescription(), "description of vocabulary $j (i=$i)"); + $this->assertIdentical($vocabulary->getHierarchy(), $i); + $this->assertIdentical($vocabulary->get('weight'), 4 + $i); } $vocabulary = Vocabulary::load('vocabulary_name_much_longer_than'); - $this->assertEqual($vocabulary->label(), 'vocabulary name much longer than thirty two characters'); - $this->assertEqual($vocabulary->getDescription(), 'description of vocabulary name much longer than thirty two characters'); - $this->assertEqual($vocabulary->getHierarchy(), 3); - $this->assertEqual($vocabulary->get('weight'), 7); + $this->assertIdentical($vocabulary->label(), 'vocabulary name much longer than thirty two characters'); + $this->assertIdentical($vocabulary->getDescription(), 'description of vocabulary name much longer than thirty two characters'); + $this->assertIdentical($vocabulary->getHierarchy(), 3); + $this->assertIdentical($vocabulary->get('weight'), 7); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeRevisionTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeRevisionTest.php index 6992929..74df698 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeRevisionTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeRevisionTest.php @@ -43,9 +43,9 @@ protected function setUp() { */ public function testTermRevisionNode() { $node = \Drupal::entityManager()->getStorage('node')->loadRevision(2); - $this->assertEqual(count($node->vocabulary_3_i_2_), 2); - $this->assertEqual($node->vocabulary_3_i_2_[0]->target_id, 4); - $this->assertEqual($node->vocabulary_3_i_2_[1]->target_id, 5); + $this->assertIdentical(count($node->vocabulary_3_i_2_), 2); + $this->assertIdentical($node->vocabulary_3_i_2_[0]->target_id, '4'); + $this->assertIdentical($node->vocabulary_3_i_2_[1]->target_id, '5'); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeTest.php index cd51592..2b81ad7 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeTest.php @@ -38,12 +38,12 @@ public function testTermNode() { $node_storage->resetCache(array(1, 2)); $nodes = Node::loadMultiple(array(1, 2)); $node = $nodes[1]; - $this->assertEqual(count($node->vocabulary_1_i_0_), 1); - $this->assertEqual($node->vocabulary_1_i_0_[0]->target_id, 1); + $this->assertIdentical(count($node->vocabulary_1_i_0_), 1); + $this->assertIdentical($node->vocabulary_1_i_0_[0]->target_id, '1'); $node = $nodes[2]; - $this->assertEqual(count($node->vocabulary_2_i_1_), 2); - $this->assertEqual($node->vocabulary_2_i_1_[0]->target_id, 2); - $this->assertEqual($node->vocabulary_2_i_1_[1]->target_id, 3); + $this->assertIdentical(count($node->vocabulary_2_i_1_), 2); + $this->assertIdentical($node->vocabulary_2_i_1_[0]->target_id, '2'); + $this->assertIdentical($node->vocabulary_2_i_1_[1]->target_id, '3'); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php index e95b243..f69630f 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php @@ -57,18 +57,18 @@ protected function setUp() { public function testUploadEntityDisplay() { $display = entity_get_display('node', 'page', 'default'); $component = $display->getComponent('upload'); - $this->assertEqual($component['type'], 'file_default'); + $this->assertIdentical($component['type'], 'file_default'); $display = entity_get_display('node', 'story', 'default'); $component = $display->getComponent('upload'); - $this->assertEqual($component['type'], 'file_default'); + $this->assertIdentical($component['type'], 'file_default'); // Assure this doesn't exist. $display = entity_get_display('node', 'article', 'default'); $component = $display->getComponent('upload'); $this->assertTrue(is_null($component)); - $this->assertEqual(array('node', 'page', 'default', 'upload'), entity_load('migration', 'd6_upload_entity_display')->getIdMap()->lookupDestinationID(array('page'))); + $this->assertIdentical(array('node', 'page', 'default', 'upload'), entity_load('migration', 'd6_upload_entity_display')->getIdMap()->lookupDestinationID(array('page'))); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php index 3eed337..a6c8533 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php @@ -58,18 +58,18 @@ protected function setUp() { public function testUploadEntityFormDisplay() { $display = entity_get_form_display('node', 'page', 'default'); $component = $display->getComponent('upload'); - $this->assertEqual($component['type'], 'file_generic'); + $this->assertIdentical($component['type'], 'file_generic'); $display = entity_get_form_display('node', 'story', 'default'); $component = $display->getComponent('upload'); - $this->assertEqual($component['type'], 'file_generic'); + $this->assertIdentical($component['type'], 'file_generic'); // Assure this doesn't exist. $display = entity_get_form_display('node', 'article', 'default'); $component = $display->getComponent('upload'); $this->assertTrue(is_null($component)); - $this->assertEqual(array('node', 'page', 'default', 'upload'), entity_load('migration', 'd6_upload_entity_form_display')->getIdMap()->lookupDestinationID(array('page'))); + $this->assertIdentical(array('node', 'page', 'default', 'upload'), entity_load('migration', 'd6_upload_entity_form_display')->getIdMap()->lookupDestinationID(array('page'))); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php index 49d2f73..332181e 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php @@ -40,8 +40,8 @@ protected function setUp() { */ public function testUpload() { $field_storage = FieldStorageConfig::load('node.upload'); - $this->assertEqual($field_storage->id(), 'node.upload'); - $this->assertEqual(array('node', 'upload'), entity_load('migration', 'd6_upload_field')->getIdMap()->lookupDestinationID(array(''))); + $this->assertIdentical($field_storage->id(), 'node.upload'); + $this->assertIdentical(array('node', 'upload'), entity_load('migration', 'd6_upload_field')->getIdMap()->lookupDestinationID(array(''))); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php index bc717fa..e613b98 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php @@ -68,19 +68,19 @@ protected function setUp() { public function testUploadFieldInstance() { $field = FieldConfig::load('node.page.upload'); $settings = $field->getSettings(); - $this->assertEqual($field->id(), 'node.page.upload'); - $this->assertEqual($settings['file_extensions'], 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'); - $this->assertEqual($settings['max_filesize'], '1MB'); - $this->assertEqual($settings['description_field'], TRUE); + $this->assertIdentical($field->id(), 'node.page.upload'); + $this->assertIdentical($settings['file_extensions'], 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'); + $this->assertIdentical($settings['max_filesize'], '1MB'); + $this->assertIdentical($settings['description_field'], TRUE); $field = FieldConfig::load('node.story.upload'); - $this->assertEqual($field->id(), 'node.story.upload'); + $this->assertIdentical($field->id(), 'node.story.upload'); // Shouldn't exist. $field = FieldConfig::load('node.article.upload'); $this->assertTrue(is_null($field)); - $this->assertEqual(array('node', 'page', 'upload'), entity_load('migration', 'd6_upload_field_instance')->getIdMap()->lookupDestinationID(array('page'))); + $this->assertIdentical(array('node', 'page', 'upload'), entity_load('migration', 'd6_upload_field_instance')->getIdMap()->lookupDestinationID(array('page'))); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php index ca1ee62..1c4cd87 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php @@ -36,19 +36,19 @@ function testUpload() { $node_storage->resetCache(array(1, 2)); $nodes = Node::loadMultiple(array(1, 2)); $node = $nodes[1]; - $this->assertEqual(count($node->upload), 1); - $this->assertEqual($node->upload[0]->target_id, 1); - $this->assertEqual($node->upload[0]->description, 'file 1-1-1'); - $this->assertEqual($node->upload[0]->isDisplayed(), FALSE); + $this->assertIdentical(count($node->upload), 1); + $this->assertIdentical($node->upload[0]->target_id, '1'); + $this->assertIdentical($node->upload[0]->description, 'file 1-1-1'); + $this->assertIdentical($node->upload[0]->isDisplayed(), FALSE); $node = $nodes[2]; - $this->assertEqual(count($node->upload), 2); - $this->assertEqual($node->upload[0]->target_id, 3); - $this->assertEqual($node->upload[0]->description, 'file 2-3-3'); - $this->assertEqual($node->upload[0]->isDisplayed(), FALSE); - $this->assertEqual($node->upload[1]->target_id, 2); - $this->assertEqual($node->upload[1]->isDisplayed(), TRUE); - $this->assertEqual($node->upload[1]->description, 'file 2-3-2'); + $this->assertIdentical(count($node->upload), 2); + $this->assertIdentical($node->upload[0]->target_id, '3'); + $this->assertIdentical($node->upload[0]->description, 'file 2-3-3'); + $this->assertIdentical($node->upload[0]->isDisplayed(), FALSE); + $this->assertIdentical($node->upload[1]->target_id, '2'); + $this->assertIdentical($node->upload[1]->isDisplayed(), TRUE); + $this->assertIdentical($node->upload[1]->description, 'file 2-3-2'); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUrlAliasTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUrlAliasTest.php index 92bcc51..7debfa1 100644 --- 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'); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityDisplayTest.php index 040c906..ef718d8 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityDisplayTest.php @@ -48,10 +48,10 @@ protected function setUp() { public function testUserPictureEntityDisplay() { $display = entity_get_display('user', 'user', 'default'); $component = $display->getComponent('user_picture'); - $this->assertEqual($component['type'], 'image'); - $this->assertEqual($component['settings']['image_link'], 'content'); + $this->assertIdentical($component['type'], 'image'); + $this->assertIdentical($component['settings']['image_link'], 'content'); - $this->assertEqual(array('user', 'user', 'default', 'user_picture'), entity_load('migration', 'd6_user_picture_entity_display')->getIdMap()->lookupDestinationID(array(''))); + $this->assertIdentical(array('user', 'user', 'default', 'user_picture'), entity_load('migration', 'd6_user_picture_entity_display')->getIdMap()->lookupDestinationID(array(''))); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php index 3a1b06a..d272bba 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php @@ -47,10 +47,10 @@ protected function setUp() { public function testUserPictureEntityFormDisplay() { $display = entity_get_form_display('user', 'user', 'default'); $component = $display->getComponent('user_picture'); - $this->assertEqual($component['type'], 'image_image'); - $this->assertEqual($component['settings']['progress_indicator'], 'throbber'); + $this->assertIdentical($component['type'], 'image_image'); + $this->assertIdentical($component['settings']['progress_indicator'], 'throbber'); - $this->assertEqual(array('user', 'user', 'default', 'user_picture'), entity_load('migration', 'd6_user_picture_entity_form_display')->getIdMap()->lookupDestinationID(array(''))); + $this->assertIdentical(array('user', 'user', 'default', 'user_picture'), entity_load('migration', 'd6_user_picture_entity_form_display')->getIdMap()->lookupDestinationID(array(''))); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFieldTest.php index e0f34bb..ed6e69b 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFieldTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFieldTest.php @@ -35,8 +35,8 @@ protected function setUp() { */ public function testUserPictureField() { $field_storage = FieldStorageConfig::load('user.user_picture'); - $this->assertEqual($field_storage->id(), 'user.user_picture'); - $this->assertEqual(array('user', 'user_picture'), entity_load('migration', 'd6_user_picture_field')->getIdMap()->lookupDestinationID(array(''))); + $this->assertIdentical($field_storage->id(), 'user.user_picture'); + $this->assertIdentical(array('user', 'user_picture'), entity_load('migration', 'd6_user_picture_field')->getIdMap()->lookupDestinationID(array(''))); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php index ecd279f..3627964 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php @@ -56,14 +56,14 @@ public function testUserPictures() { $files = entity_load_multiple('file', $file_ids); /** @var \Drupal\file\FileInterface $file */ $file = array_shift($files); - $this->assertEqual($file->getFilename(), 'image-test.jpg'); - $this->assertEqual($file->getFileUri(), 'public://image-test.jpg'); - $this->assertEqual($file->getSize(), 1901); - $this->assertEqual($file->getMimeType(), 'image/jpeg'); + $this->assertIdentical($file->getFilename(), 'image-test.jpg'); + $this->assertIdentical($file->getFileUri(), 'public://image-test.jpg'); + $this->assertIdentical($file->getSize(), '1901'); + $this->assertIdentical($file->getMimeType(), 'image/jpeg'); $file = array_shift($files); - $this->assertEqual($file->getFilename(), 'image-test.png'); - $this->assertEqual($file->getFileUri(), 'public://image-test.png'); + $this->assertIdentical($file->getFilename(), 'image-test.png'); + $this->assertIdentical($file->getFileUri(), 'public://image-test.png'); $this->assertFalse($files); } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php index edd676a..08015a3 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php @@ -55,12 +55,12 @@ protected function setUp() { public function testUserPictureFieldInstance() { $field = FieldConfig::load('user.user.user_picture'); $settings = $field->getSettings(); - $this->assertEqual($settings['file_extensions'], 'png gif jpg jpeg'); - $this->assertEqual($settings['file_directory'], 'pictures'); - $this->assertEqual($settings['max_filesize'], '30KB'); - $this->assertEqual($settings['max_resolution'], '85x85'); + $this->assertIdentical($settings['file_extensions'], 'png gif jpg jpeg'); + $this->assertIdentical($settings['file_directory'], 'pictures'); + $this->assertIdentical($settings['max_filesize'], '30KB'); + $this->assertIdentical($settings['max_resolution'], '85x85'); - $this->assertEqual(array('user', 'user', 'user_picture'), entity_load('migration', 'd6_user_picture_field_instance')->getIdMap()->lookupDestinationID(array(''))); + $this->assertIdentical(array('user', 'user', 'user_picture'), entity_load('migration', 'd6_user_picture_field_instance')->getIdMap()->lookupDestinationID(array(''))); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php index 69dc0eb..001935e 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php @@ -110,15 +110,15 @@ public function testUserProfileFields() { // Test a text field. $component = $display->getComponent('profile_color'); - $this->assertEqual($component['type'], 'text_default'); + $this->assertIdentical($component['type'], 'text_default'); // Test a list field. $component = $display->getComponent('profile_bands'); - $this->assertEqual($component['type'], 'text_default'); + $this->assertIdentical($component['type'], 'text_default'); // Test a date field. $component = $display->getComponent('profile_birthdate'); - $this->assertEqual($component['type'], 'datetime_default'); + $this->assertIdentical($component['type'], 'datetime_default'); // Test PROFILE_PRIVATE field is hidden. $this->assertNull($display->getComponent('profile_sell_address')); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php index a92ce81..23583ca 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php @@ -107,15 +107,15 @@ public function testUserProfileEntityFormDisplay() { // Test a text field. $component = $display->getComponent('profile_color'); - $this->assertEqual($component['type'], 'text_textfield'); + $this->assertIdentical($component['type'], 'text_textfield'); // Test a list field. $component = $display->getComponent('profile_bands'); - $this->assertEqual($component['type'], 'text_textfield'); + $this->assertIdentical($component['type'], 'text_textfield'); // Test a date field. $component = $display->getComponent('profile_birthdate'); - $this->assertEqual($component['type'], 'datetime_default'); + $this->assertIdentical($component['type'], 'datetime_default'); // Test PROFILE_PRIVATE field is hidden. $this->assertNull($display->getComponent('profile_sell_address')); @@ -125,8 +125,8 @@ public function testUserProfileEntityFormDisplay() { // Test that a checkbox field has the proper display label setting. $component = $display->getComponent('profile_love_migrations'); - $this->assertEqual($component['type'], 'boolean_checkbox'); - $this->assertEqual($component['settings']['display_label'], true); + $this->assertIdentical($component['type'], 'boolean_checkbox'); + $this->assertIdentical($component['settings']['display_label'], true); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php index faa481b..9ed9249 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php @@ -54,45 +54,45 @@ protected function setUp() { public function testUserProfileFields() { // Migrated a text field. $field = FieldConfig::load('user.user.profile_color'); - $this->assertEqual($field->label(), 'Favorite color'); - $this->assertEqual($field->getDescription(), 'List your favorite color'); + $this->assertIdentical($field->label(), 'Favorite color'); + $this->assertIdentical($field->getDescription(), 'List your favorite color'); // Migrated a textarea. $field = FieldConfig::load('user.user.profile_biography'); - $this->assertEqual($field->label(), 'Biography'); - $this->assertEqual($field->getDescription(), 'Tell people a little bit about yourself'); + $this->assertIdentical($field->label(), 'Biography'); + $this->assertIdentical($field->getDescription(), 'Tell people a little bit about yourself'); // Migrated checkbox field. $field = FieldConfig::load('user.user.profile_sell_address'); - $this->assertEqual($field->label(), 'Sell your email address?'); - $this->assertEqual($field->getDescription(), "If you check this box, we'll sell your address to spammers to help line the pockets of our shareholders. Thanks!"); + $this->assertIdentical($field->label(), 'Sell your email address?'); + $this->assertIdentical($field->getDescription(), "If you check this box, we'll sell your address to spammers to help line the pockets of our shareholders. Thanks!"); // Migrated selection field. $field = FieldConfig::load('user.user.profile_sold_to'); - $this->assertEqual($field->label(), 'Sales Category'); - $this->assertEqual($field->getDescription(), "Select the sales categories to which this user's address was sold."); + $this->assertIdentical($field->label(), 'Sales Category'); + $this->assertIdentical($field->getDescription(), "Select the sales categories to which this user's address was sold."); // Migrated list field. $field = FieldConfig::load('user.user.profile_bands'); - $this->assertEqual($field->label(), 'Favorite bands'); - $this->assertEqual($field->getDescription(), "Enter your favorite bands. When you've saved your profile, you'll be able to find other people with the same favorites."); + $this->assertIdentical($field->label(), 'Favorite bands'); + $this->assertIdentical($field->getDescription(), "Enter your favorite bands. When you've saved your profile, you'll be able to find other people with the same favorites."); /* // Migrated URL field. $field = FieldConfig::load('user.user.profile_blog'); - $this->assertEqual($field->label(), 'Your blog'); - $this->assertEqual($field->getDescription(), "Paste the full URL, including http://, of your personal blog."); + $this->assertIdentical($field->label(), 'Your blog'); + $this->assertIdentical($field->getDescription(), "Paste the full URL, including http://, of your personal blog."); */ // Migrated date field. $field = FieldConfig::load('user.user.profile_birthdate'); - $this->assertEqual($field->label(), 'Birthdate'); - $this->assertEqual($field->getDescription(), "Enter your birth date and we'll send you a coupon."); + $this->assertIdentical($field->label(), 'Birthdate'); + $this->assertIdentical($field->getDescription(), "Enter your birth date and we'll send you a coupon."); // Another migrated checkbox field, with a different source visibility setting. $field = FieldConfig::load('user.user.profile_love_migrations'); - $this->assertEqual($field->label(), 'I love migrations'); - $this->assertEqual($field->getDescription(), "If you check this box, you love migrations."); + $this->assertIdentical($field->label(), 'I love migrations'); + $this->assertIdentical($field->getDescription(), "If you check this box, you love migrations."); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php index 0c3b5c6..35644ce 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php @@ -44,22 +44,22 @@ protected function setUp() { public function testUserProfileFields() { // Migrated a text field. $field_storage = FieldStorageConfig::load('user.profile_color'); - $this->assertEqual($field_storage->type, 'text', 'Field type is text.'); - $this->assertEqual($field_storage->cardinality, 1, 'Text field has correct cardinality'); + $this->assertIdentical($field_storage->type, 'text', 'Field type is text.'); + $this->assertIdentical($field_storage->cardinality, 1, 'Text field has correct cardinality'); // Migrated a textarea. $field_storage = FieldStorageConfig::load('user.profile_biography'); - $this->assertEqual($field_storage->type, 'text_long', 'Field type is text_long.'); + $this->assertIdentical($field_storage->type, 'text_long', 'Field type is text_long.'); // Migrated checkbox field. $field_storage = FieldStorageConfig::load('user.profile_sell_address'); - $this->assertEqual($field_storage->type, 'boolean', 'Field type is boolean.'); + $this->assertIdentical($field_storage->type, 'boolean', 'Field type is boolean.'); // Migrated selection field. $field_storage = FieldStorageConfig::load('user.profile_sold_to'); - $this->assertEqual($field_storage->type, 'list_string', 'Field type is list_string.'); + $this->assertIdentical($field_storage->type, 'list_string', 'Field type is list_string.'); $settings = $field_storage->getSettings(); - $this->assertEqual($settings['allowed_values'], array( + $this->assertIdentical($settings['allowed_values'], array( 'Pill spammers' => 'Pill spammers', 'Fitness spammers' => 'Fitness spammers', 'Back\slash' => 'Back\slash', @@ -68,23 +68,23 @@ public function testUserProfileFields() { 'Faithful servant' => 'Faithful servant', 'Anonymous donor' => 'Anonymous donor', )); - $this->assertEqual($field_storage->type, 'list_string', 'Field type is list_string.'); + $this->assertIdentical($field_storage->type, 'list_string', 'Field type is list_string.'); // Migrated list field. $field_storage = FieldStorageConfig::load('user.profile_bands'); - $this->assertEqual($field_storage->type, 'text', 'Field type is text.'); - $this->assertEqual($field_storage->cardinality, -1, 'List field has correct cardinality'); + $this->assertIdentical($field_storage->type, 'text', 'Field type is text.'); + $this->assertIdentical($field_storage->cardinality, -1, 'List field has correct cardinality'); /* // Migrated URL field. $field_storage = FieldStorageConfig::load('user.profile_blog'); - $this->assertEqual($field_storage->type, 'link', 'Field type is link.'); + $this->assertIdentical($field_storage->type, 'link', 'Field type is link.'); */ // Migrated date field. $field_storage = FieldStorageConfig::load('user.profile_birthdate'); - $this->assertEqual($field_storage->type, 'datetime', 'Field type is datetime.'); - $this->assertEqual($field_storage->settings['datetime_type'], 'date'); + $this->assertIdentical($field_storage->type, 'datetime', 'Field type is datetime.'); + $this->assertIdentical($field_storage->settings['datetime_type'], 'date'); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php index 465b6d5..a0a7bb0 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php @@ -152,24 +152,24 @@ protected function setUp() { public function testUserProfileValues() { $user = User::load(2); $this->assertFalse(is_null($user)); - $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, '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'); - $this->assertEqual($user->profile_bands[3]->value, 'Lemonheads'); - $this->assertEqual($user->profile_bands[4]->value, 'Rolling Stones'); - $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'); + $this->assertIdentical($user->profile_color->value, 'red'); + $this->assertIdentical($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->assertIdentical($user->profile_sell_address->value, '1'); + $this->assertIdentical($user->profile_sold_to->value, 'Back\slash'); + $this->assertIdentical($user->profile_bands[0]->value, 'AC/DC'); + $this->assertIdentical($user->profile_bands[1]->value, 'Eagles'); + $this->assertIdentical($user->profile_bands[2]->value, 'Elton John'); + $this->assertIdentical($user->profile_bands[3]->value, 'Lemonheads'); + $this->assertIdentical($user->profile_bands[4]->value, 'Rolling Stones'); + $this->assertIdentical($user->profile_bands[5]->value, 'Queen'); + $this->assertIdentical($user->profile_bands[6]->value, 'The White Stripes'); + $this->assertIdentical($user->profile_birthdate->value, '1974-06-02'); $user = User::load(8); - $this->assertEqual($user->profile_sold_to->value, 'Forward/slash'); + $this->assertIdentical($user->profile_sold_to->value, 'Forward/slash'); $user = User::load(15); - $this->assertEqual($user->profile_sold_to->value, 'Dot.in.the.middle'); + $this->assertIdentical($user->profile_sold_to->value, 'Dot.in.the.middle'); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php index bb3ad6f..3f977bc 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php @@ -61,22 +61,22 @@ public function testUserRole() { $migration = entity_load('migration', 'd6_user_role'); $rid = 'anonymous'; $anonymous = Role::load($rid); - $this->assertEqual($anonymous->id(), $rid); - $this->assertEqual($anonymous->getPermissions(), array('migrate test anonymous permission', 'use text format filtered_html')); - $this->assertEqual(array($rid), $migration->getIdMap()->lookupDestinationId(array(1))); + $this->assertIdentical($anonymous->id(), $rid); + $this->assertIdentical($anonymous->getPermissions(), array('migrate test anonymous permission', 'use text format filtered_html')); + $this->assertIdentical(array($rid), $migration->getIdMap()->lookupDestinationId(array(1))); $rid = 'authenticated'; $authenticated = Role::load($rid); - $this->assertEqual($authenticated->id(), $rid); - $this->assertEqual($authenticated->getPermissions(), array('migrate test authenticated permission', 'use text format filtered_html')); - $this->assertEqual(array($rid), $migration->getIdMap()->lookupDestinationId(array(2))); + $this->assertIdentical($authenticated->id(), $rid); + $this->assertIdentical($authenticated->getPermissions(), array('migrate test authenticated permission', 'use text format filtered_html')); + $this->assertIdentical(array($rid), $migration->getIdMap()->lookupDestinationId(array(2))); $rid = 'migrate_test_role_1'; $migrate_test_role_1 = Role::load($rid); - $this->assertEqual($migrate_test_role_1->id(), $rid); - $this->assertEqual($migrate_test_role_1->getPermissions(), array(0 => 'migrate test role 1 test permission', 'use text format full_html')); - $this->assertEqual(array($rid), $migration->getIdMap()->lookupDestinationId(array(3))); + $this->assertIdentical($migrate_test_role_1->id(), $rid); + $this->assertIdentical($migrate_test_role_1->getPermissions(), array(0 => 'migrate test role 1 test permission', 'use text format full_html')); + $this->assertIdentical(array($rid), $migration->getIdMap()->lookupDestinationId(array(3))); $rid = 'migrate_test_role_2'; $migrate_test_role_2 = Role::load($rid); - $this->assertEqual($migrate_test_role_2->getPermissions(), array( + $this->assertIdentical($migrate_test_role_2->getPermissions(), array( 'migrate test role 2 test permission', 'use PHP for settings', 'administer contact forms', @@ -93,12 +93,12 @@ public function testUserRole() { 'administer nodes', 'access content overview', )); - $this->assertEqual($migrate_test_role_2->id(), $rid); - $this->assertEqual(array($rid), $migration->getIdMap()->lookupDestinationId(array(4))); + $this->assertIdentical($migrate_test_role_2->id(), $rid); + $this->assertIdentical(array($rid), $migration->getIdMap()->lookupDestinationId(array(4))); $rid = 'migrate_test_role_3_that_is_long'; $migrate_test_role_3 = Role::load($rid); - $this->assertEqual($migrate_test_role_3->id(), $rid); - $this->assertEqual(array($rid), $migration->getIdMap()->lookupDestinationId(array(5))); + $this->assertIdentical($migrate_test_role_3->id(), $rid); + $this->assertIdentical(array($rid), $migration->getIdMap()->lookupDestinationId(array(5))); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php index 7ca1274..6f216cb 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php @@ -160,30 +160,30 @@ public function testUser() { $signature_format = $source->signature_format === '0' ? [NULL] : $migration_format->getIdMap()->lookupDestinationId(array($source->signature_format)); $user = User::load($source->uid); - $this->assertEqual($user->id(), $source->uid); - $this->assertEqual($user->label(), $source->name); - $this->assertEqual($user->getEmail(), $source->mail); - $this->assertEqual($user->getSignature(), $source->signature); + $this->assertIdentical($user->id(), $source->uid); + $this->assertIdentical($user->label(), $source->name); + $this->assertIdentical($user->getEmail(), $source->mail); + $this->assertIdentical($user->getSignature(), $source->signature); $this->assertIdentical($user->getSignatureFormat(), reset($signature_format)); - $this->assertEqual($user->getCreatedTime(), $source->created); - $this->assertEqual($user->getLastAccessedTime(), $source->access); - $this->assertEqual($user->getLastLoginTime(), $source->login); + $this->assertIdentical($user->getCreatedTime(), $source->created); + $this->assertIdentical($user->getLastAccessedTime(), $source->access); + $this->assertIdentical($user->getLastLoginTime(), $source->login); $is_blocked = $source->status == 0; - $this->assertEqual($user->isBlocked(), $is_blocked); + $this->assertIdentical($user->isBlocked(), $is_blocked); // $user->getPreferredLangcode() might fallback to default language if the // user preferred language is not configured on the site. We just want to // test if the value was imported correctly. - $this->assertEqual($user->preferred_langcode->value, $source->language); + $this->assertIdentical($user->preferred_langcode->value, $source->language); $time_zone = $source->expected_timezone ?: $this->config('system.date')->get('timezone.default'); - $this->assertEqual($user->getTimeZone(), $time_zone); - $this->assertEqual($user->getInitialEmail(), $source->init); - $this->assertEqual($user->getRoles(), $roles); + $this->assertIdentical($user->getTimeZone(), $time_zone); + $this->assertIdentical($user->getInitialEmail(), $source->init); + $this->assertIdentical($user->getRoles(), $roles); // 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); - $this->assertEqual($file->getFilename(), basename($source->picture)); + $this->assertIdentical($file->getFilename(), basename($source->picture)); } // Use the UI to check if the password has been salted and re-hashed to diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateViewModesTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateViewModesTest.php index 4fa1282..22ac840 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateViewModesTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateViewModesTest.php @@ -49,10 +49,10 @@ protected function setUp() { public function testViewModes() { // Test a new view mode. $view_mode = EntityViewMode::load('node.preview'); - $this->assertEqual(is_null($view_mode), FALSE, 'Preview view mode loaded.'); - $this->assertEqual($view_mode->label(), 'Preview', 'View mode has correct label.'); + $this->assertIdentical(is_null($view_mode), FALSE, 'Preview view mode loaded.'); + $this->assertIdentical($view_mode->label(), 'Preview', 'View mode has correct label.'); // Test the Id Map. - $this->assertEqual(array('node', 'preview'), entity_load('migration', 'd6_view_modes')->getIdMap()->lookupDestinationID(array(1))); + $this->assertIdentical(array('node', 'preview'), entity_load('migration', 'd6_view_modes')->getIdMap()->lookupDestinationID(array(1))); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php index 2bd19c6..6865294 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php @@ -75,10 +75,10 @@ protected function setUp() { public function testVocabularyEntityDisplay() { // Test that the field exists. $component = entity_get_display('node', 'page', 'default')->getComponent('tags'); - $this->assertEqual($component['type'], 'taxonomy_term_reference_link'); - $this->assertEqual($component['weight'], 20); + $this->assertIdentical($component['type'], 'taxonomy_term_reference_link'); + $this->assertIdentical($component['weight'], 20); // Test the Id map. - $this->assertEqual(array('node', 'article', 'default', 'tags'), entity_load('migration', 'd6_vocabulary_entity_display')->getIdMap()->lookupDestinationID(array(4, 'article'))); + $this->assertIdentical(array('node', 'article', 'default', 'tags'), entity_load('migration', 'd6_vocabulary_entity_display')->getIdMap()->lookupDestinationID(array(4, 'article'))); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php index 5d56c44..17878c3 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php @@ -76,10 +76,10 @@ protected function setUp() { public function testVocabularyEntityFormDisplay() { // Test that the field exists. $component = entity_get_form_display('node', 'page', 'default')->getComponent('tags'); - $this->assertEqual($component['type'], 'options_select'); - $this->assertEqual($component['weight'], 20); + $this->assertIdentical($component['type'], 'options_select'); + $this->assertIdentical($component['weight'], 20); // Test the Id map. - $this->assertEqual(array('node', 'article', 'default', 'tags'), entity_load('migration', 'd6_vocabulary_entity_form_display')->getIdMap()->lookupDestinationID(array(4, 'article'))); + $this->assertIdentical(array('node', 'article', 'default', 'tags'), entity_load('migration', 'd6_vocabulary_entity_form_display')->getIdMap()->lookupDestinationID(array(4, 'article'))); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php index ec7f221..dad5356 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php @@ -86,14 +86,14 @@ public function testVocabularyFieldInstance() { // Test that the field exists. $field_id = 'node.article.tags'; $field = FieldConfig::load($field_id); - $this->assertEqual($field->id(), $field_id, 'Field instance exists on article bundle.'); + $this->assertIdentical($field->id(), $field_id, 'Field instance exists on article bundle.'); // Test the page bundle as well. $field_id = 'node.page.tags'; $field = FieldConfig::load($field_id); - $this->assertEqual($field->id(), $field_id, 'Field instance exists on page bundle.'); + $this->assertIdentical($field->id(), $field_id, 'Field instance exists on page bundle.'); - $this->assertEqual(array('node', 'article', 'tags'), entity_load('migration', 'd6_vocabulary_field_instance')->getIdMap()->lookupDestinationID(array(4, 'article'))); + $this->assertIdentical(array('node', 'article', 'tags'), entity_load('migration', 'd6_vocabulary_field_instance')->getIdMap()->lookupDestinationID(array(4, 'article'))); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php index 7760d0e..ecae929 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php @@ -62,10 +62,10 @@ public function testVocabularyField() { // Test that the field exists. $field_storage_id = 'node.tags'; $field_storage = FieldStorageConfig::load($field_storage_id); - $this->assertEqual($field_storage->id(), $field_storage_id); + $this->assertIdentical($field_storage->id(), $field_storage_id); $settings = $field_storage->getSettings(); - $this->assertEqual('tags', $settings['allowed_values'][0]['vocabulary'], "Vocabulary has correct settings."); - $this->assertEqual(array('node', 'tags'), entity_load('migration', 'd6_vocabulary_field')->getIdMap()->lookupDestinationID(array(4)), "Test IdMap"); + $this->assertIdentical('tags', $settings['allowed_values'][0]['vocabulary'], "Vocabulary has correct settings."); + $this->assertIdentical(array('node', 'tags'), entity_load('migration', 'd6_vocabulary_field')->getIdMap()->lookupDestinationID(array(4)), "Test IdMap"); } } diff --git a/core/modules/migrate_drupal/src/Tests/dependencies/MigrateDependenciesTest.php b/core/modules/migrate_drupal/src/Tests/dependencies/MigrateDependenciesTest.php index 0e0193d..244d609 100644 --- a/core/modules/migrate_drupal/src/Tests/dependencies/MigrateDependenciesTest.php +++ b/core/modules/migrate_drupal/src/Tests/dependencies/MigrateDependenciesTest.php @@ -29,7 +29,7 @@ public function testMigrateDependenciesOrder() { $migration_items = array('d6_comment', 'd6_filter_format', 'd6_node'); $migrations = entity_load_multiple('migration', $migration_items); $expected_order = array('d6_filter_format', 'd6_node', 'd6_comment'); - $this->assertEqual(array_keys($migrations), $expected_order); + $this->assertIdentical(array_keys($migrations), $expected_order); $expected_requirements = array( 'd6_node', 'd6_node_type', @@ -43,9 +43,9 @@ public function testMigrateDependenciesOrder() { // Migration dependencies for comment include dependencies for node // migration as well. $actual_requirements = $migrations['d6_comment']->get('requirements'); - $this->assertEqual(count($actual_requirements), count($expected_requirements)); + $this->assertIdentical(count($actual_requirements), count($expected_requirements)); foreach ($expected_requirements as $requirement) { - $this->assertEqual($actual_requirements[$requirement], $requirement); + $this->assertIdentical($actual_requirements[$requirement], $requirement); } } @@ -62,7 +62,7 @@ public function testAggregatorMigrateDependencies() { $executable = new MigrateExecutable($migration, $this); $this->startCollectingMessages(); $executable->import(); - $this->assertEqual($this->migrateMessages['error'], array(String::format('Migration @id did not meet the requirements. Missing migrations d6_aggregator_feed. requirements: d6_aggregator_feed.', array('@id' => $migration->id())))); + $this->assertIdentical($this->migrateMessages['error'], array(String::format('Migration @id did not meet the requirements. Missing migrations d6_aggregator_feed. requirements: d6_aggregator_feed.', array('@id' => $migration->id())))); $this->collectMessages = FALSE; }