only in patch2: unchanged: --- a/core/modules/comment/src/CommentManager.php +++ b/core/modules/comment/src/CommentManager.php @@ -121,15 +121,18 @@ public function addBodyField($comment_type_id) { )); $field->save(); - // Assign widget settings for the 'default' form mode. - entity_get_form_display('comment', $comment_type_id, 'default') + /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */ + $display_repository = \Drupal::service('entity_display.repository'); + + // Assign widget settings for the default form mode. + $display_repository->getFormDisplay('comment', $comment_type_id) ->setComponent('comment_body', array( 'type' => 'text_textarea', )) ->save(); - // Assign display settings for the 'default' view mode. - entity_get_display('comment', $comment_type_id, 'default') + // Assign display settings for the default view mode. + $display_repository->getViewDisplay('comment', $comment_type_id) ->setComponent('comment_body', array( 'label' => 'hidden', 'type' => 'text_default', only in patch2: unchanged: --- a/core/modules/comment/src/Tests/CommentLinksTest.php +++ b/core/modules/comment/src/Tests/CommentLinksTest.php @@ -101,8 +101,11 @@ public function testCommentLinks() { $this->assertLink('Add new comment'); } + /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */ + $display_repository = $this->container->get('entity_display.repository'); + // Change weight to make links go before comment body. - entity_get_display('comment', 'comment', 'default') + $display_repository->getViewDisplay('comment', 'comment') ->setComponent('links', array('weight' => -100)) ->save(); $this->drupalGet($this->node->urlInfo()); @@ -112,7 +115,7 @@ public function testCommentLinks() { $this->assertIdentical($element[0]->getName(), 'div', 'Last element is comment body.'); // Change weight to make links go after comment body. - entity_get_display('comment', 'comment', 'default') + $display_repository->getViewDisplay('comment', 'comment') ->setComponent('links', array('weight' => 100)) ->save(); $this->drupalGet($this->node->urlInfo()); @@ -122,7 +125,7 @@ public function testCommentLinks() { $this->assertIdentical($element[0]->getName(), 'ul', 'Last element is comment links.'); // Make sure we can hide node links. - entity_get_display('node', $this->node->bundle(), 'default') + $display_repository->getViewDisplay('node', $this->node->bundle()) ->removeComponent('links') ->save(); $this->drupalGet($this->node->urlInfo()); @@ -135,7 +138,7 @@ public function testCommentLinks() { $this->assertLink('Reply'); // Make sure we can hide comment links. - entity_get_display('comment', 'comment', 'default') + $display_repository->getViewDisplay('comment', 'comment') ->removeComponent('links') ->save(); $this->drupalGet('node/' . $this->node->id()); only in patch2: unchanged: --- a/core/modules/config/src/Tests/ConfigExportImportUITest.php +++ b/core/modules/config/src/Tests/ConfigExportImportUITest.php @@ -115,18 +115,20 @@ public function testExportImport() { ])->save(); // Update the displays so that configuration does not change unexpectedly on // import. - entity_get_form_display('node', $this->contentType->id(), 'default') + /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */ + $display_repository = $this->container->get('entity_display.repository'); + $display_repository->getFormDisplay('node', $this->contentType->id()) ->setComponent($this->fieldName, array( 'type' => 'text_textfield', )) ->save(); - entity_get_display('node', $this->contentType->id(), 'full') + $display_repository->getViewDisplay('node', $this->contentType->id(), 'full') ->setComponent($this->fieldName) ->save(); - entity_get_display('node', $this->contentType->id(), 'default') + $display_repository->getViewDisplay('node', $this->contentType->id()) ->setComponent($this->fieldName) ->save(); - entity_get_display('node', $this->contentType->id(), 'teaser') + $display_repository->getViewDisplay('node', $this->contentType->id(), 'teaser') ->removeComponent($this->fieldName) ->save(); only in patch2: unchanged: --- a/core/modules/datetime/src/Tests/DateTimeFieldTest.php +++ b/core/modules/datetime/src/Tests/DateTimeFieldTest.php @@ -97,11 +97,16 @@ function testDateField() { // the default time, so that is applied before calculating the expected // value. datetime_date_default_time($date); + + /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */ + $display_repository = $this->container->get('entity_display.repository'); + foreach ($options as $setting => $values) { foreach ($values as $new_value) { // Update the entity display settings. $this->displayOptions['settings'] = array($setting => $new_value) + $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); @@ -122,7 +127,7 @@ function testDateField() { // Verify that the plain formatter works. $this->displayOptions['type'] = 'datetime_plain'; $this->displayOptions['settings'] = $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $date->format(DATETIME_DATE_STORAGE_FORMAT); @@ -132,7 +137,7 @@ function testDateField() { // Verify that the 'datetime_custom' formatter works. $this->displayOptions['type'] = 'datetime_custom'; $this->displayOptions['settings'] = array('date_format' => 'm/d/Y') + $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $date->format($this->displayOptions['settings']['date_format']); @@ -157,7 +162,7 @@ function testDateField() { 'past_format' => '@interval in the past', 'granularity' => 3, ); - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = SafeMarkup::format($this->displayOptions['settings']['past_format'], [ @@ -178,7 +183,7 @@ function testDateField() { $entity->{$field_name}->value = $date->format($date_format); $entity->save(); - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = SafeMarkup::format($this->displayOptions['settings']['future_format'], [ @@ -225,6 +230,9 @@ function testDatetimeField() { $this->assertRaw($date->format($date_format)); $this->assertRaw($date->format($time_format)); + /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */ + $display_repository = $this->container->get('entity_display.repository'); + // Verify that the date is output according to the formatter settings. $options = array( 'format_type' => array('short', 'medium', 'long'), @@ -233,7 +241,7 @@ function testDatetimeField() { foreach ($values as $new_value) { // Update the entity display settings. $this->displayOptions['settings'] = array($setting => $new_value) + $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); @@ -253,7 +261,7 @@ function testDatetimeField() { // Verify that the plain formatter works. $this->displayOptions['type'] = 'datetime_plain'; $this->displayOptions['settings'] = $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $date->format(DATETIME_DATETIME_STORAGE_FORMAT); @@ -263,7 +271,7 @@ function testDatetimeField() { // Verify that the 'datetime_custom' formatter works. $this->displayOptions['type'] = 'datetime_custom'; $this->displayOptions['settings'] = array('date_format' => 'm/d/Y g:i:s A') + $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $date->format($this->displayOptions['settings']['date_format']); @@ -273,7 +281,7 @@ function testDatetimeField() { // Verify that the 'timezone_override' setting works. $this->displayOptions['type'] = 'datetime_custom'; $this->displayOptions['settings'] = array('date_format' => 'm/d/Y g:i:s A', 'timezone_override' => 'America/New_York') + $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $date->format($this->displayOptions['settings']['date_format'], array('timezone' => 'America/New_York')); @@ -298,7 +306,7 @@ function testDatetimeField() { 'past_format' => '@interval earlier', 'granularity' => 3, ); - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = SafeMarkup::format($this->displayOptions['settings']['past_format'], [ @@ -319,7 +327,7 @@ function testDatetimeField() { $entity->{$field_name}->value = $date->format(DATETIME_DATETIME_STORAGE_FORMAT); $entity->save(); - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = SafeMarkup::format($this->displayOptions['settings']['future_format'], [ only in patch2: unchanged: --- a/core/modules/datetime_range/src/Tests/DateRangeFieldTest.php +++ b/core/modules/datetime_range/src/Tests/DateRangeFieldTest.php @@ -118,8 +118,11 @@ public function testDateRangeField() { ] + $this->defaultSettings, ]; + /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */ + $display_repository = $this->container->get('entity_display.repository'); + // Verify that the default formatter works. - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); @@ -148,7 +151,7 @@ public function testDateRangeField() { // Verify that the plain formatter works. $this->displayOptions['type'] = 'daterange_plain'; $this->displayOptions['settings'] = $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $start_date->format(DATETIME_DATE_STORAGE_FORMAT) . ' - ' . $end_date->format(DATETIME_DATE_STORAGE_FORMAT); @@ -158,7 +161,7 @@ public function testDateRangeField() { // Verify that the custom formatter works. $this->displayOptions['type'] = 'daterange_custom'; $this->displayOptions['settings'] = array('date_format' => 'm/d/Y') + $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $start_date->format($this->displayOptions['settings']['date_format']) . ' - ' . $end_date->format($this->displayOptions['settings']['date_format']); @@ -194,7 +197,7 @@ public function testDateRangeField() { ] + $this->defaultSettings, ]; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); @@ -215,7 +218,7 @@ public function testDateRangeField() { $this->displayOptions['type'] = 'daterange_plain'; $this->displayOptions['settings'] = $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $start_date->format(DATETIME_DATE_STORAGE_FORMAT); @@ -225,7 +228,7 @@ public function testDateRangeField() { $this->displayOptions['type'] = 'daterange_custom'; $this->displayOptions['settings'] = array('date_format' => 'm/d/Y') + $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $start_date->format($this->displayOptions['settings']['date_format']); @@ -281,12 +284,15 @@ public function testDatetimeRangeField() { $this->assertRaw($end_date->format($date_format)); $this->assertRaw($end_date->format($time_format)); + /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */ + $display_repository = $this->container->get('entity_display.repository'); + // Verify that the default formatter works. $this->displayOptions['settings'] = [ 'format_type' => 'long', 'separator' => 'THESEPARATOR', ] + $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); @@ -307,7 +313,7 @@ public function testDatetimeRangeField() { // Verify that the plain formatter works. $this->displayOptions['type'] = 'daterange_plain'; $this->displayOptions['settings'] = $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $start_date->format(DATETIME_DATETIME_STORAGE_FORMAT) . ' - ' . $end_date->format(DATETIME_DATETIME_STORAGE_FORMAT); @@ -317,7 +323,7 @@ public function testDatetimeRangeField() { // Verify that the 'datetime_custom' formatter works. $this->displayOptions['type'] = 'daterange_custom'; $this->displayOptions['settings'] = ['date_format' => 'm/d/Y g:i:s A'] + $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $start_date->format($this->displayOptions['settings']['date_format']) . ' - ' . $end_date->format($this->displayOptions['settings']['date_format']); @@ -327,7 +333,7 @@ public function testDatetimeRangeField() { // Verify that the 'timezone_override' setting works. $this->displayOptions['type'] = 'daterange_custom'; $this->displayOptions['settings'] = ['date_format' => 'm/d/Y g:i:s A', 'timezone_override' => 'America/New_York'] + $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $start_date->format($this->displayOptions['settings']['date_format'], ['timezone' => 'America/New_York']); @@ -365,7 +371,7 @@ public function testDatetimeRangeField() { ] + $this->defaultSettings, ]; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); @@ -382,7 +388,7 @@ public function testDatetimeRangeField() { $this->displayOptions['type'] = 'daterange_plain'; $this->displayOptions['settings'] = $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $start_date->format(DATETIME_DATETIME_STORAGE_FORMAT); @@ -392,7 +398,7 @@ public function testDatetimeRangeField() { $this->displayOptions['type'] = 'daterange_custom'; $this->displayOptions['settings'] = ['date_format' => 'm/d/Y g:i:s A'] + $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $start_date->format($this->displayOptions['settings']['date_format']); @@ -442,12 +448,15 @@ public function testAlldayRangeField() { $this->assertRaw($end_date->format($date_format)); $this->assertNoRaw($end_date->format($time_format)); + /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */ + $display_repository = $this->container->get('entity_display.repository'); + // Verify that the default formatter works. $this->displayOptions['settings'] = [ 'format_type' => 'long', 'separator' => 'THESEPARATOR', ] + $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); @@ -468,7 +477,7 @@ public function testAlldayRangeField() { // Verify that the plain formatter works. $this->displayOptions['type'] = 'daterange_plain'; $this->displayOptions['settings'] = $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $start_date->format(DATETIME_DATETIME_STORAGE_FORMAT) . ' - ' . $end_date->format(DATETIME_DATETIME_STORAGE_FORMAT); @@ -478,7 +487,7 @@ public function testAlldayRangeField() { // Verify that the custom formatter works. $this->displayOptions['type'] = 'daterange_custom'; $this->displayOptions['settings'] = array('date_format' => 'm/d/Y') + $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $start_date->format($this->displayOptions['settings']['date_format']) . ' - ' . $end_date->format($this->displayOptions['settings']['date_format']); @@ -488,7 +497,7 @@ public function testAlldayRangeField() { // Verify that the 'timezone_override' setting works. $this->displayOptions['type'] = 'daterange_custom'; $this->displayOptions['settings'] = ['date_format' => 'm/d/Y g:i:s A', 'timezone_override' => 'America/New_York'] + $this->defaultSettings; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $start_date->format($this->displayOptions['settings']['date_format'], ['timezone' => 'America/New_York']); @@ -525,7 +534,7 @@ public function testAlldayRangeField() { ] + $this->defaultSettings, ]; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); @@ -544,7 +553,7 @@ public function testAlldayRangeField() { $this->assertFieldByXPath('//div[@data-field-item-attr="foobar"]'); $this->displayOptions['type'] = 'daterange_plain'; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $start_date->format(DATETIME_DATETIME_STORAGE_FORMAT) . ' THESEPARATOR ' . $end_date->format(DATETIME_DATETIME_STORAGE_FORMAT); @@ -554,7 +563,7 @@ public function testAlldayRangeField() { $this->displayOptions['type'] = 'daterange_custom'; $this->displayOptions['settings']['date_format'] = 'm/d/Y'; - entity_get_display($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') + $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); $expected = $start_date->format($this->displayOptions['settings']['date_format']) . ' THESEPARATOR ' . $end_date->format($this->displayOptions['settings']['date_format']); only in patch2: unchanged: --- a/core/modules/editor/tests/src/Kernel/QuickEditIntegrationTest.php +++ b/core/modules/editor/tests/src/Kernel/QuickEditIntegrationTest.php @@ -125,7 +125,9 @@ protected function getSelectedEditor($entity_id, $field_name, $view_mode = 'defa $storage->resetCache([$entity_id]); $entity = $storage->load($entity_id); $items = $entity->get($field_name); - $options = entity_get_display('entity_test', 'entity_test', $view_mode)->getComponent($field_name); + $options = $this->container->get('entity_display.repository') + ->getViewDisplay('entity_test', 'entity_test', $view_mode) + ->getComponent($field_name); return $this->editorSelector->getEditor($options['type'], $items); } only in patch2: unchanged: --- a/core/modules/field/src/Tests/Boolean/BooleanFieldTest.php +++ b/core/modules/field/src/Tests/Boolean/BooleanFieldTest.php @@ -84,14 +84,17 @@ function testBooleanField() { )); $this->field->save(); + /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */ + $display_repository = $this->container->get('entity_display.repository'); + // Create a form display for the default form mode. - entity_get_form_display('entity_test', 'entity_test', 'default') + $display_repository->getFormDisplay('entity_test', 'entity_test') ->setComponent($field_name, array( 'type' => 'boolean_checkbox', )) ->save(); // Create a display for the full view mode. - entity_get_display('entity_test', 'entity_test', 'full') + $display_repository->getViewDisplay('entity_test', 'entity_test', 'full') ->setComponent($field_name, array( 'type' => 'boolean', )) @@ -114,13 +117,13 @@ function testBooleanField() { // Verify that boolean value is displayed. $entity = EntityTest::load($id); - $display = entity_get_display($entity->getEntityTypeId(), $entity->bundle(), 'full'); + $display = $display_repository->getViewDisplay($entity->getEntityTypeId(), $entity->bundle(), 'full'); $content = $display->build($entity); $this->setRawContent(\Drupal::service('renderer')->renderRoot($content)); $this->assertRaw('