.../lib/Drupal/entity/Tests/EntityDisplayTest.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayTest.php b/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayTest.php index 31ea4e8..6bda3f2 100644 --- a/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayTest.php +++ b/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayTest.php @@ -42,9 +42,10 @@ public function testEntityDisplayCRUD() { $expected = array(); // Check that providing no 'weight' results in the highest current weight - // being assigned. - $expected['component_1'] = array('weight' => 0); - $expected['component_2'] = array('weight' => 1); + // being assigned. The 'name' field's formatter has weight -5, therefore + // these follow. + $expected['component_1'] = array('weight' => -4); + $expected['component_2'] = array('weight' => -3); $display->setComponent('component_1'); $display->setComponent('component_2'); $this->assertEqual($display->getComponent('component_1'), $expected['component_1']); @@ -63,6 +64,12 @@ public function testEntityDisplayCRUD() { } // Check that getComponents() returns options for all components. + $expected['name'] = array( + 'label' => 'hidden', + 'type' => 'string', + 'weight' => -5, + 'settings' => array(), + ); $this->assertEqual($display->getComponents(), $expected); // Check that a component can be removed. @@ -164,7 +171,7 @@ public function testFieldComponent() { $default_formatter = $field_type_info['default_formatter']; $formatter_settings = \Drupal::service('plugin.manager.field.formatter')->getDefaultSettings($default_formatter); $expected = array( - 'weight' => 0, + 'weight' => -4, 'label' => 'above', 'type' => $default_formatter, 'settings' => $formatter_settings,