You are here

public function EntityManagerTest::testGetViewDisplay in Drupal 8

@covers ::getViewDisplay

@expectedDeprecation EntityManager::getViewDisplay() is deprecated in drupal:8.8.0 and will be removed before Drupal 9.0.0. Use \Drupal::service('entity_display.repository')->getViewDisplay() instead.

File

core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php, line 583

Class

EntityManagerTest
@coversDefaultClass \Drupal\Core\Entity\EntityManager @group Entity @group legacy

Namespace

Drupal\Tests\Core\Entity

Code

public function testGetViewDisplay() {
  $view_display = $this
    ->prophesize(EntityViewDisplayInterface::class)
    ->reveal();
  $this->entityDisplayRepository
    ->getViewDisplay('entity_test', 'bundle', 'default')
    ->shouldBeCalled()
    ->willReturn($view_display);
  $this
    ->assertInstanceOf(EntityViewDisplayInterface::class, $this->entityManager
    ->getViewDisplay('entity_test', 'bundle', 'default'));
}