public function EntityLegacyTest::testLegacyDisplayFunctions in Drupal 8
@expectedDeprecation entity_get_display() is deprecated in drupal:8.8.0. It will be removed before drupal:9.0.0. Use \Drupal::service('entity_display.repository')->getViewDisplay() instead. See https://www.drupal.org/node/2835616 @expectedDeprecation entity_get_form_display() is deprecated in drupal:8.8.0. It will be removed before drupal:9.0.0. Use \Drupal::service('entity_display.repository')->getFormDisplay() instead. See https://www.drupal.org/node/2835616
File
- core/
tests/ Drupal/ KernelTests/ Core/ Entity/ EntityLegacyTest.php, line 100
Class
- EntityLegacyTest
- Tests legacy entity functions.
Namespace
Drupal\KernelTests\Core\EntityCode
public function testLegacyDisplayFunctions() {
$view_display = entity_get_display('entity_test', 'entity_test', 'default');
$this
->assertInstanceOf(EntityViewDisplayInterface::class, $view_display);
$this
->assertEquals('entity_test.entity_test.default', $view_display
->id());
$form_display = entity_get_form_display('entity_test', 'entity_test', 'default');
$this
->assertInstanceOf(EntityFormDisplayInterface::class, $form_display);
$this
->assertEquals('entity_test.entity_test.default', $form_display
->id());
}