Commit b1d2d7c3 authored by alexpott's avatar alexpott

Issue #2345833 by quietone, benjy: Convert assetEqual to assertIdentical in migrate_drupal

parent 27050971
......@@ -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');
}
}
......@@ -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(), "<h2 id='new'>What's new with Drupal 8?</h2>");
$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(), "<h2 id='new'>What's new with Drupal 8?</h2>");
$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');
}
......
......@@ -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('<h3>My first custom block body</h3>', $block->body->value);
$this->assertEqual('full_html', $block->body->format);
$this->assertIdentical('en', $block->language()->getId());
$this->assertIdentical('<h3>My first custom block body</h3>', $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('<h3>My second custom block body</h3>', $block->body->value);
$this->assertEqual('full_html', $block->body->format);
$this->assertIdentical('en', $block->language()->getId());
$this->assertIdentical('<h3>My second custom block body</h3>', $block->body->value);
$this->assertIdentical('full_html', $block->body->format);
}
}
......@@ -87,98 +87,98 @@ protected function setUp() {
*/
public function testBlockMigration() {
$blocks = Block::loadMultiple();
$this->assertEqual(count($blocks), 10);
$this->assertIdentical(count($blocks), 10);
// 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());
$test_block_user_2 = $blocks['user_2'];
$this->assertNotNull($test_block_user_2);
$this->assertEqual('sidebar_second', $test_block_user_2->getRegion());
$this->assertEqual('bartik', $test_block_user_2->getTheme());
$this->assertIdentical('sidebar_second', $test_block_user_2->getRegion());
$this->assertIdentical('bartik', $test_block_user_2->getTheme());
$visibility = $test_block_user_2->getVisibility();
$this->assertEqual($visibility['user_role']['id'], 'user_role');
$this->assertIdentical($visibility['user_role']['id'], 'user_role');
$roles = array();
$roles['authenticated'] = 'authenticated';
$this->assertEqual($visibility['user_role']['roles'], $roles);
$this->assertIdentical($visibility['user_role']['roles'], $roles);
$this->assertFalse($visibility['user_role']['negate']);
$this->assertEqual(-9, $test_block_user_2->getWeight());
$this->assertIdentical(-9, $test_block_user_2->getWeight());
$test_block_user_3 = $blocks['user_3'];
$this->assertNotNull($test_block_user_3);
$this->assertEqual('sidebar_second', $test_block_user_3->getRegion());
$this->assertEqual('bartik', $test_block_user_3->getTheme());
$this->assertIdentical('sidebar_second', $test_block_user_3->getRegion());
$this->assertIdentical('bartik', $test_block_user_3->getTheme());
$visibility = $test_block_user_3->getVisibility();
$this->assertEqual($visibility['user_role']['id'], 'user_role');
$this->assertIdentical($visibility['user_role']['id'], 'user_role');
$roles = array();
$roles['migrate_test_role_1'] = 'migrate_test_role_1';
$this->assertEqual($visibility['user_role']['roles'], $roles);
$this->assertIdentical($visibility['user_role']['roles'], $roles);
$this->assertFalse($visibility['user_role']['negate']);
$this->assertEqual(-6, $test_block_user_3->getWeight());
$this->assertIdentical(-6, $test_block_user_3->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'], '<front>');
$this->assertEqual(0, $test_block_block->getWeight());
$this->assertIdentical($visibility['request_path']['pages'], '<front>');
$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());
}
}
......@@ -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());
}
......
......@@ -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.');
}
}
......@@ -84,7 +84,9 @@ protected function setUp() {
entity_create('field_storage_config', array(
'entity_type' => 'node',
'field_name' => 'field_multivalue',
'type' => 'integer',
'type' => 'decimal',
'precision' => '10',
'scale' => '2',
'cardinality' => -1,
))->save();
entity_create('field_config', array(
......@@ -167,16 +169,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 +190,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');
}
}
......@@ -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);
}
}
......@@ -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());
}
}
......@@ -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);
}
}
}
......@@ -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);
......
......@@ -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);
}
}
......
......@@ -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);
}
}
......@@ -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);
}
}
......@@ -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());
}
......
......@@ -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';