Commit c01a6803 authored by alexpott's avatar alexpott

Issue #2403743 by quietone, rpayanm: assertion style in migration

parent 6f83b4e7
...@@ -46,7 +46,7 @@ protected function setUp() { ...@@ -46,7 +46,7 @@ protected function setUp() {
*/ */
public function testActionSettings() { public function testActionSettings() {
$config = $this->config('action.settings'); $config = $this->config('action.settings');
$this->assertIdentical($config->get('recursion_limit'), 35); $this->assertIdentical(35, $config->get('recursion_limit'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'action.settings', $config->get()); $this->assertConfigSchema(\Drupal::service('config.typed'), 'action.settings', $config->get());
} }
......
...@@ -46,13 +46,13 @@ protected function setUp() { ...@@ -46,13 +46,13 @@ protected function setUp() {
*/ */
public function testAggregatorSettings() { public function testAggregatorSettings() {
$config = $this->config('aggregator.settings'); $config = $this->config('aggregator.settings');
$this->assertIdentical($config->get('fetcher'), 'aggregator'); $this->assertIdentical('aggregator', $config->get('fetcher'));
$this->assertIdentical($config->get('parser'), 'aggregator'); $this->assertIdentical('aggregator', $config->get('parser'));
$this->assertIdentical($config->get('processors'), array('aggregator')); $this->assertIdentical(array('aggregator'), $config->get('processors'));
$this->assertIdentical($config->get('items.teaser_length'), 600); $this->assertIdentical(600, $config->get('items.teaser_length'));
$this->assertIdentical($config->get('items.allowed_html'), '<a> <b> <br /> <dd> <dl> <dt> <em> <i> <li> <ol> <p> <strong> <u> <ul>'); $this->assertIdentical('<a> <b> <br /> <dd> <dl> <dt> <em> <i> <li> <ol> <p> <strong> <u> <ul>', $config->get('items.allowed_html'));
$this->assertIdentical($config->get('items.expire'), 9676800); $this->assertIdentical(9676800, $config->get('items.expire'));
$this->assertIdentical($config->get('source.list_max'), 3); $this->assertIdentical(3, $config->get('source.list_max'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'aggregator.settings', $config->get()); $this->assertConfigSchema(\Drupal::service('config.typed'), 'aggregator.settings', $config->get());
} }
......
...@@ -41,16 +41,16 @@ public function testAggregatorFeedImport() { ...@@ -41,16 +41,16 @@ public function testAggregatorFeedImport() {
/** @var Feed $feed */ /** @var Feed $feed */
$feed = Feed::load(5); $feed = Feed::load(5);
$this->assertNotNull($feed->uuid()); $this->assertNotNull($feed->uuid());
$this->assertIdentical($feed->title->value, 'Know Your Meme'); $this->assertIdentical('Know Your Meme', $feed->title->value);
$this->assertIdentical($feed->language()->getId(), 'en'); $this->assertIdentical('en', $feed->language()->getId());
$this->assertIdentical($feed->url->value, 'http://knowyourmeme.com/newsfeed.rss'); $this->assertIdentical('http://knowyourmeme.com/newsfeed.rss', $feed->url->value);
$this->assertIdentical($feed->refresh->value, '900'); $this->assertIdentical('900', $feed->refresh->value);
$this->assertIdentical($feed->checked->value, '1387659487'); $this->assertIdentical('1387659487', $feed->checked->value);
$this->assertIdentical($feed->queued->value, '0'); $this->assertIdentical('0', $feed->queued->value);
$this->assertIdentical($feed->link->value, 'http://knowyourmeme.com'); $this->assertIdentical('http://knowyourmeme.com', $feed->link->value);
$this->assertIdentical($feed->description->value, 'New items added to the News Feed'); $this->assertIdentical('New items added to the News Feed', $feed->description->value);
$this->assertIdentical($feed->image->value, 'http://b.thumbs.redditmedia.com/harEHsUUZVajabtC.png'); $this->assertIdentical('http://b.thumbs.redditmedia.com/harEHsUUZVajabtC.png', $feed->image->value);
$this->assertIdentical($feed->etag->value, '"213cc1365b96c310e92053c5551f0504"'); $this->assertIdentical('"213cc1365b96c310e92053c5551f0504"', $feed->etag->value);
$this->assertIdentical($feed->modified->value, '0'); $this->assertIdentical('0', $feed->modified->value);
} }
} }
...@@ -60,15 +60,15 @@ protected function setUp() { ...@@ -60,15 +60,15 @@ protected function setUp() {
public function testAggregatorItem() { public function testAggregatorItem() {
/** @var Item $item */ /** @var Item $item */
$item = Item::load(1); $item = Item::load(1);
$this->assertIdentical($item->id(), '1'); $this->assertIdentical('1', $item->id());
$this->assertIdentical($item->getFeedId(), '5'); $this->assertIdentical('5', $item->getFeedId());
$this->assertIdentical($item->label(), 'This (three) weeks in Drupal Core - January 10th 2014'); $this->assertIdentical('This (three) weeks in Drupal Core - January 10th 2014', $item->label());
$this->assertIdentical($item->getAuthor(), 'larowlan'); $this->assertIdentical('larowlan', $item->getAuthor());
$this->assertIdentical($item->getDescription(), "<h2 id='new'>What's new with Drupal 8?</h2>"); $this->assertIdentical("<h2 id='new'>What's new with Drupal 8?</h2>", $item->getDescription());
$this->assertIdentical($item->getLink(), 'https://groups.drupal.org/node/395218'); $this->assertIdentical('https://groups.drupal.org/node/395218', $item->getLink());
$this->assertIdentical($item->getPostedTime(), '1389297196'); $this->assertIdentical('1389297196', $item->getPostedTime());
$this->assertIdentical($item->language()->getId(), 'en'); $this->assertIdentical('en', $item->language()->getId());
$this->assertIdentical($item->getGuid(), '395218 at https://groups.drupal.org'); $this->assertIdentical('395218 at https://groups.drupal.org', $item->getGuid());
} }
......
...@@ -47,9 +47,9 @@ protected function setUp() { ...@@ -47,9 +47,9 @@ protected function setUp() {
*/ */
public function testBookSettings() { public function testBookSettings() {
$config = $this->config('book.settings'); $config = $this->config('book.settings');
$this->assertIdentical($config->get('child_type'), 'book'); $this->assertIdentical('book', $config->get('child_type'));
$this->assertIdentical($config->get('block.navigation.mode'), 'all pages'); $this->assertIdentical('all pages', $config->get('block.navigation.mode'));
$this->assertIdentical($config->get('allowed_types'), array('book')); $this->assertIdentical(array('book'), $config->get('allowed_types'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'book.settings', $config->get()); $this->assertConfigSchema(\Drupal::service('config.typed'), 'book.settings', $config->get());
} }
......
...@@ -55,28 +55,28 @@ protected function setUp() { ...@@ -55,28 +55,28 @@ protected function setUp() {
*/ */
public function testBook() { public function testBook() {
$nodes = Node::loadMultiple(array(4, 5, 6, 7, 8)); $nodes = Node::loadMultiple(array(4, 5, 6, 7, 8));
$this->assertIdentical($nodes[4]->book['bid'], '4'); $this->assertIdentical('4', $nodes[4]->book['bid']);
$this->assertIdentical($nodes[4]->book['pid'], '0'); $this->assertIdentical('0', $nodes[4]->book['pid']);
$this->assertIdentical($nodes[5]->book['bid'], '4'); $this->assertIdentical('4', $nodes[5]->book['bid']);
$this->assertIdentical($nodes[5]->book['pid'], '4'); $this->assertIdentical('4', $nodes[5]->book['pid']);
$this->assertIdentical($nodes[6]->book['bid'], '4'); $this->assertIdentical('4', $nodes[6]->book['bid']);
$this->assertIdentical($nodes[6]->book['pid'], '5'); $this->assertIdentical('5', $nodes[6]->book['pid']);
$this->assertIdentical($nodes[7]->book['bid'], '4'); $this->assertIdentical('4', $nodes[7]->book['bid']);
$this->assertIdentical($nodes[7]->book['pid'], '5'); $this->assertIdentical('5', $nodes[7]->book['pid']);
$this->assertIdentical($nodes[8]->book['bid'], '8'); $this->assertIdentical('8', $nodes[8]->book['bid']);
$this->assertIdentical($nodes[8]->book['pid'], '0'); $this->assertIdentical('0', $nodes[8]->book['pid']);
$tree = \Drupal::service('book.manager')->bookTreeAllData(4); $tree = \Drupal::service('book.manager')->bookTreeAllData(4);
$this->assertIdentical($tree['49990 Node 4 4']['link']['nid'], '4'); $this->assertIdentical('4', $tree['49990 Node 4 4']['link']['nid']);
$this->assertIdentical($tree['49990 Node 4 4']['below']['50000 Node 5 5']['link']['nid'], '5'); $this->assertIdentical('5', $tree['49990 Node 4 4']['below']['50000 Node 5 5']['link']['nid']);
$this->assertIdentical($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['link']['nid'], '6'); $this->assertIdentical('6', $tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['link']['nid']);
$this->assertIdentical($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['link']['nid'], '7'); $this->assertIdentical('7', $tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['link']['nid']);
$this->assertIdentical($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['below'], array()); $this->assertIdentical(array(), $tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['below']);
$this->assertIdentical($tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['below'], array()); $this->assertIdentical(array(), $tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['below']);
} }
} }
...@@ -76,8 +76,8 @@ protected function setUp() { ...@@ -76,8 +76,8 @@ protected function setUp() {
*/ */
public function testCckFieldRevision() { public function testCckFieldRevision() {
$node = \Drupal::entityManager()->getStorage('node')->loadRevision(2); $node = \Drupal::entityManager()->getStorage('node')->loadRevision(2);
$this->assertIdentical($node->id(), '1', 'Node 1 loaded.'); $this->assertIdentical('1', $node->id(), 'Node 1 loaded.');
$this->assertIdentical($node->getRevisionId(), '2', 'Node 1 revision 2loaded.'); $this->assertIdentical('2', $node->getRevisionId(), 'Node 1 revision 2loaded.');
} }
} }
...@@ -169,29 +169,29 @@ protected function setUp() { ...@@ -169,29 +169,29 @@ protected function setUp() {
public function testCckFields() { public function testCckFields() {
$node = Node::load(1); $node = Node::load(1);
$this->assertIdentical($node->field_test->value, 'This is a shared text field'); $this->assertIdentical('This is a shared text field', $node->field_test->value);
$this->assertIdentical($node->field_test->format, 'filtered_html'); $this->assertIdentical('filtered_html', $node->field_test->format);
$this->assertIdentical($node->field_test_two->value, '10'); $this->assertIdentical('10', $node->field_test_two->value);
$this->assertIdentical($node->field_test_two[1]->value, '20'); $this->assertIdentical('20', $node->field_test_two[1]->value);
$this->assertIdentical($node->field_test_three->value, '42.42', 'Single field second value is correct.'); $this->assertIdentical('42.42', $node->field_test_three->value, 'Single field second value is correct.');
$this->assertIdentical($node->field_test_integer_selectlist[0]->value, '3412'); $this->assertIdentical('3412', $node->field_test_integer_selectlist[0]->value);
$this->assertIdentical($node->field_test_identical1->value, '1', 'Integer value is correct'); $this->assertIdentical('1', $node->field_test_identical1->value, 'Integer value is correct');
$this->assertIdentical($node->field_test_identical2->value, '1', 'Integer value is correct'); $this->assertIdentical('1', $node->field_test_identical2->value, '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.'); $this->assertIdentical('This is a field with exclude unset.', $node->field_test_exclude_unset->value, 'Field with exclude unset is correct.');
// Test that link fields are migrated. // Test that link fields are migrated.
$this->assertIdentical($node->field_test_link->uri, 'http://drupal.org/project/drupal'); $this->assertIdentical('http://drupal.org/project/drupal', $node->field_test_link->uri);
$this->assertIdentical($node->field_test_link->title, 'Drupal project page'); $this->assertIdentical('Drupal project page', $node->field_test_link->title);
$this->assertIdentical($node->field_test_link->options['attributes'], ['target' => '_blank']); $this->assertIdentical(['target' => '_blank'], $node->field_test_link->options['attributes']);
// Test the file field meta. // Test the file field meta.
$this->assertIdentical($node->field_test_filefield->description, 'desc'); $this->assertIdentical('desc', $node->field_test_filefield->description);
$this->assertIdentical($node->field_test_filefield->target_id, '5'); $this->assertIdentical('5', $node->field_test_filefield->target_id);
$planet_node = Node::load(3); $planet_node = Node::load(3);
$this->assertIdentical($planet_node->field_multivalue->value, '33.00'); $this->assertIdentical('33.00', $planet_node->field_multivalue->value);
$this->assertIdentical($planet_node->field_multivalue[1]->value, '44.00'); $this->assertIdentical('44.00', $planet_node->field_multivalue[1]->value);
} }
} }
...@@ -30,9 +30,9 @@ class MigrateCommentVariableEntityDisplayTest extends MigrateCommentVariableDisp ...@@ -30,9 +30,9 @@ class MigrateCommentVariableEntityDisplayTest extends MigrateCommentVariableDisp
public function testCommentEntityDisplay() { public function testCommentEntityDisplay() {
foreach ($this->types as $type) { foreach ($this->types as $type) {
$component = entity_get_display('node', $type, 'default')->getComponent('comment'); $component = entity_get_display('node', $type, 'default')->getComponent('comment');
$this->assertIdentical($component['label'], 'hidden'); $this->assertIdentical('hidden', $component['label']);
$this->assertIdentical($component['type'], 'comment_default'); $this->assertIdentical('comment_default', $component['type']);
$this->assertIdentical($component['weight'], 20); $this->assertIdentical(20, $component['weight']);
} }
} }
} }
...@@ -60,8 +60,8 @@ protected function setUp() { ...@@ -60,8 +60,8 @@ protected function setUp() {
public function testCommentEntityFormDisplay() { public function testCommentEntityFormDisplay() {
$component = entity_get_form_display('comment', 'comment', 'default') $component = entity_get_form_display('comment', 'comment', 'default')
->getComponent('subject'); ->getComponent('subject');
$this->assertIdentical($component['type'], 'string_textfield'); $this->assertIdentical('string_textfield', $component['type']);
$this->assertIdentical($component['weight'], 10); $this->assertIdentical(10, $component['weight']);
$component = entity_get_form_display('comment', 'comment_no_subject', 'default') $component = entity_get_form_display('comment', 'comment_no_subject', 'default')
->getComponent('subject'); ->getComponent('subject');
$this->assertNull($component); $this->assertNull($component);
......
...@@ -25,8 +25,8 @@ class MigrateCommentVariableEntityFormDisplayTest extends MigrateCommentVariable ...@@ -25,8 +25,8 @@ class MigrateCommentVariableEntityFormDisplayTest extends MigrateCommentVariable
public function testCommentEntityFormDisplay() { public function testCommentEntityFormDisplay() {
foreach ($this->types as $type) { foreach ($this->types as $type) {
$component = entity_get_form_display('node', $type, 'default')->getComponent('comment'); $component = entity_get_form_display('node', $type, 'default')->getComponent('comment');
$this->assertIdentical($component['type'], 'comment_default'); $this->assertIdentical('comment_default', $component['type']);
$this->assertIdentical($component['weight'], 20); $this->assertIdentical(20, $component['weight']);
} }
} }
......
...@@ -66,24 +66,24 @@ protected function setUp() { ...@@ -66,24 +66,24 @@ protected function setUp() {
*/ */
public function testCommentFieldInstance() { public function testCommentFieldInstance() {
$node = entity_create('node', array('type' => 'page')); $node = entity_create('node', array('type' => 'page'));
$this->assertIdentical($node->comment->status, 0); $this->assertIdentical(0, $node->comment->status);
$this->assertIdentical($node->comment->getFieldDefinition()->getName(), 'comment'); $this->assertIdentical('comment', $node->comment->getFieldDefinition()->getName());
$settings = $node->comment->getFieldDefinition()->getSettings(); $settings = $node->comment->getFieldDefinition()->getSettings();
$this->assertIdentical($settings['default_mode'], 4); $this->assertIdentical(4, $settings['default_mode']);
$this->assertIdentical($settings['per_page'], 50); $this->assertIdentical(50, $settings['per_page']);
$this->assertIdentical($settings['anonymous'], 0); $this->assertIdentical(0, $settings['anonymous']);
$this->assertIdentical($settings['form_location'], FALSE); $this->assertIdentical(FALSE, $settings['form_location']);
$this->assertIdentical($settings['preview'], 1); $this->assertIdentical(1, $settings['preview']);
$node = entity_create('node', array('type' => 'story')); $node = entity_create('node', array('type' => 'story'));
$this->assertIdentical($node->comment_no_subject->status, 2); $this->assertIdentical(2, $node->comment_no_subject->status);
$this->assertIdentical($node->comment_no_subject->getFieldDefinition()->getName(), 'comment_no_subject'); $this->assertIdentical('comment_no_subject', $node->comment_no_subject->getFieldDefinition()->getName());
$settings = $node->comment_no_subject->getFieldDefinition()->getSettings(); $settings = $node->comment_no_subject->getFieldDefinition()->getSettings();
$this->assertIdentical($settings['default_mode'], 2); $this->assertIdentical(2, $settings['default_mode']);
$this->assertIdentical($settings['per_page'], 70); $this->assertIdentical(70, $settings['per_page']);
$this->assertIdentical($settings['anonymous'], 1); $this->assertIdentical(1, $settings['anonymous']);
$this->assertIdentical($settings['form_location'], FALSE); $this->assertIdentical(FALSE, $settings['form_location']);
$this->assertIdentical($settings['preview'], 0); $this->assertIdentical(0, $settings['preview']);
} }
} }
...@@ -46,22 +46,22 @@ protected function setUp() { ...@@ -46,22 +46,22 @@ protected function setUp() {
public function testContactCategory() { public function testContactCategory() {
/** @var \Drupal\contact\Entity\ContactForm $contact_form */ /** @var \Drupal\contact\Entity\ContactForm $contact_form */
$contact_form = ContactForm::load('website_feedback'); $contact_form = ContactForm::load('website_feedback');
$this->assertIdentical($contact_form->label(), 'Website feedback'); $this->assertIdentical('Website feedback', $contact_form->label());
$this->assertIdentical($contact_form->getRecipients(), array('admin@example.com')); $this->assertIdentical(array('admin@example.com'), $contact_form->getRecipients());
$this->assertIdentical($contact_form->getReply(), ''); $this->assertIdentical('', $contact_form->getReply());
$this->assertIdentical($contact_form->getWeight(), 0); $this->assertIdentical(0, $contact_form->getWeight());
$contact_form = ContactForm::load('some_other_category'); $contact_form = ContactForm::load('some_other_category');
$this->assertIdentical($contact_form->label(), 'Some other category'); $this->assertIdentical('Some other category', $contact_form->label());
$this->assertIdentical($contact_form->getRecipients(), array('test@example.com')); $this->assertIdentical(array('test@example.com'), $contact_form->getRecipients());
$this->assertIdentical($contact_form->getReply(), 'Thanks for contacting us, we will reply ASAP!'); $this->assertIdentical('Thanks for contacting us, we will reply ASAP!', $contact_form->getReply());
$this->assertIdentical($contact_form->getWeight(), 1); $this->assertIdentical(1, $contact_form->getWeight());
$contact_form = ContactForm::load('a_category_much_longer_than_thir'); $contact_form = ContactForm::load('a_category_much_longer_than_thir');
$this->assertIdentical($contact_form->label(), 'A category much longer than thirty two characters'); $this->assertIdentical('A category much longer than thirty two characters', $contact_form->label());
$this->assertIdentical($contact_form->getRecipients(), array('fortyninechars@example.com')); $this->assertIdentical(array('fortyninechars@example.com'), $contact_form->getRecipients());
$this->assertIdentical($contact_form->getReply(), ''); $this->assertIdentical('', $contact_form->getReply());
$this->assertIdentical($contact_form->getWeight(), 2); $this->assertIdentical(2, $contact_form->getWeight());
} }
} }
...@@ -56,9 +56,9 @@ protected function setUp() { ...@@ -56,9 +56,9 @@ protected function setUp() {
*/ */
public function testContactSettings() { public function testContactSettings() {
$config = $this->config('contact.settings'); $config = $this->config('contact.settings');
$this->assertIdentical($config->get('user_default_enabled'), true); $this->assertIdentical(true, $config->get('user_default_enabled'));
$this->assertIdentical($config->get('flood.limit'), 3); $this->assertIdentical(3, $config->get('flood.limit'));
$this->assertIdentical($config->get('default_form'), 'some_other_category'); $this->assertIdentical('some_other_category', $config->get('default_form'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'contact.settings', $config->get()); $this->assertConfigSchema(\Drupal::service('config.typed'), 'contact.settings', $config->get());
} }
......
...@@ -47,7 +47,7 @@ protected function setUp() { ...@@ -47,7 +47,7 @@ protected function setUp() {
*/ */
public function testBookSettings() { public function testBookSettings() {
$config = $this->config('dblog.settings'); $config = $this->config('dblog.settings');
$this->assertIdentical($config->get('row_limit'), 1000); $this->assertIdentical(1000, $config->get('row_limit'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'dblog.settings', $config->get()); $this->assertConfigSchema(\Drupal::service('config.typed'), 'dblog.settings', $config->get());
} }
......
...@@ -93,23 +93,23 @@ public function testEntityDisplaySettings() { ...@@ -93,23 +93,23 @@ public function testEntityDisplaySettings() {
// Can we load any entity display. // Can we load any entity display.
$display = entity_load('entity_view_display', 'node.story.teaser'); $display = entity_load('entity_view_display', 'node.story.teaser');
$this->assertIdentical($display->getComponent($field_name), $expected); $this->assertIdentical($expected, $display->getComponent($field_name));
// Test migrate worked with multiple bundles. // Test migrate worked with multiple bundles.
$display = entity_load('entity_view_display', 'node.test_page.teaser'); $display = entity_load('entity_view_display', 'node.test_page.teaser');
$expected['weight'] = 35; $expected['weight'] = 35;
$this->assertIdentical($display->getComponent($field_name), $expected); $this->assertIdentical($expected, $display->getComponent($field_name));
// Test RSS because that has been converted from 4 to rss. // Test RSS because that has been converted from 4 to rss.
$display = entity_load('entity_view_display', 'node.story.rss'); $display = entity_load('entity_view_display', 'node.story.rss');
$expected['weight'] = 1; $expected['weight'] = 1;
$this->assertIdentical($display->getComponent($field_name), $expected); $this->assertIdentical($expected, $display->getComponent($field_name));
// Test the default format with text_default which comes from a static map. // Test the default format with text_default which comes from a static map.
$expected['type'] = 'text_default'; $expected['type'] = 'text_default';
$expected['settings'] = array(); $expected['settings'] = array();
$display = entity_load('entity_view_display', 'node.story.default'); $display = entity_load('entity_view_display', 'node.story.default');
$this->assertIdentical($display->getComponent($field_name), $expected); $this->assertIdentical($expected, $display->getComponent($field_name));
// Check that we can migrate multiple fields. // Check that we can migrate multiple fields.
$content = $display->get('content'); $content = $display->get('content');
...@@ -127,7 +127,7 @@ public function testEntityDisplaySettings() { ...@@ -127,7 +127,7 @@ public function testEntityDisplaySettings() {
'prefix_suffix' => TRUE, 'prefix_suffix' => TRUE,
); );
$component = $display->getComponent('field_test_two'); $component = $display->getComponent('field_test_two');
$this->assertIdentical($component, $expected); $this->assertIdentical($expected, $component);
$expected['weight'] = 2; $expected['weight'] = 2;
$expected['type'] = 'number_decimal'; $expected['type'] = 'number_decimal';
$expected['settings'] = array( $expected['settings'] = array(
...@@ -137,14 +137,14 @@ public function testEntityDisplaySettings() { ...@@ -137,14 +137,14 @@ public function testEntityDisplaySettings() {
'prefix_suffix' => TRUE, 'prefix_suffix' => TRUE,
); );
$component = $display->getComponent('field_test_three'); $component = $display->getComponent('field_test_three');
$this->assertIdentical($component, $expected); $this->assertIdentical($expected, $component);
// Test the email field formatter settings are correct. // Test the email field formatter settings are correct.
$expected['weight'] = 6; $expected['weight'] = 6;
$expected['type'] = 'email_mailto'; $expected['type'] = 'email_mailto';
$expected['settings'] = array(); $expected['settings'] = array();
$component = $display->getComponent('field_test_email'); $component = $display->getComponent('field_test_email');
$this->assertIdentical($component, $expected); $this->assertIdentical($expected, $component);
// Test the link field formatter settings. // Test the link field formatter settings.
$expected['weight'] = 7; $expected['weight'] = 7;
...@@ -157,79 +157,79 @@ public function testEntityDisplaySettings() { ...@@ -157,79 +157,79 @@ public function testEntityDisplaySettings() {
'target' => '0', 'target' => '0',
); );
$component = $display->getComponent('field_test_link'); $component = $display->getComponent('field_test_link');
$this->assertIdentical($component, $expected); $this->assertIdentical($expected, $component);
$expected['settings']['url_only'] = FALSE; $expected['settings']['url_only'] = FALSE;
$expected['settings']['url_plain'] = FALSE; $expected['settings']['url_plain'] = FALSE;
$display = entity_load('entity_view_display', 'node.story.teaser'); $display = entity_load('entity_view_display', 'node.story.teaser');
$component = $display->getComponent('field_test_link'); $component = $display->getComponent('field_test_link');
$this->assertIdentical($component, $expected); $this->assertIdentical($expected, $component);
// Test the file field formatter settings. // Test the file field formatter settings.
$expected['weight'] = 8; $expected['weight'] = 8;
$expected['type'] = 'file_default'; $expected['type'] = 'file_default';
$expected['settings'] = array(); $expected['settings'] = array();
$component = $display->getComponent('field_test_filefield'); $component = $display->getComponent('field_test_filefield');
$this->assertIdentical($component, $expected); $this->assertIdentical($expected, $component);
$display = entity_load('entity_view_display', 'node.story.default'); $display = entity_load('entity_view_display', 'node.story.default');
$expected['type'] = 'file_url_plain'; $expected['type'] = 'file_url_plain';
$component = $display->getComponent('field_test_filefield'); $component = $display->getComponent('field_test_filefield');
$this->assertIdentical($component, $expected); $this->assertIdentical($expected, $component);
// Test the image field formatter settings. // Test the image field formatter settings.
$expected['weight'] = 9; $expected['weight'] = 9;
$expected['type'] = 'image'; $expected['type'] = 'image';
$expected['settings'] = array('image_style' => '', 'image_link' => ''); $expected['settings'] = array('image_style' => '', 'image_link' => '');
$component = $display->getComponent('field_test_imagefield'); $component = $display->getComponent('field_test_imagefield');
$this->assertIdentical($component, $expected); $this->assertIdentical($expected, $component);
$display = entity_load('entity_view_display', 'node.story.teaser'); $display = entity_load('entity_view_display', 'node.story.teaser');
$expected['settings']['image_link'] = 'file'; $expected['settings']['image_link'] = 'file';
$component = $display->getComponent('field_test_imagefield'); $component = $display->getComponent('field_test_imagefield');
$this->assertIdentical($component, $expected); $this->assertIdentical($expected, $component);
// Test phone field. // Test phone field.
$expected['weight'] = 13; $expected['weight'] = 13;
$expected['type'] = 'basic_string'; $expected['type'] = 'basic_string';
$expected['settings'] = array(); $expected['settings'] = array();
$component = $display->getComponent('field_test_phone'); $component = $display->getComponent('field_test_phone');
$this->assertIdentical($component, $expected); $this->assertIdentical($expected, $component);
// Test date field. // Test date field.
$expected['weight'] = 10; $expected['weight'] = 10;
$expected['type'] = 'datetime_default'; $expected['type'] = 'datetime_default';
$expected['settings'] = array('format_type' => 'fallback'); $expected['settings'] = array('format_type' => 'fallback');
$component = $display->getComponent('field_test_date'); $component = $display->getComponent('field_test_date');
$this->assertIdentical($component, $expected); $this->assertIdentical($expected, $component);
$display = entity_load('entity_view_display', 'node.story.default'); $display = entity_load('entity_view_display', 'node.story.default');
$expected['settings']['format_type'] = 'long'; $expected