Commit 96a7c8f7 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2605904 by jmikii, swatichouhan012, kishor_kolekar, willzyx, vacho,...

Issue #2605904 by jmikii, swatichouhan012, kishor_kolekar, willzyx, vacho, Berdir, alexpott: Missing return statement in EntityManager::clearDisplayModeInfo()
parent 280bd1b8
Loading
Loading
Loading
Loading
+1 −0
Changes for core/lib/Drupal/Core/Entity/EntityManager.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -594,6 +594,7 @@ public function getFormModeOptionsByBundle($entity_type_id, $bundle) {
  public function clearDisplayModeInfo() {
    @trigger_error('EntityManagerInterface::clearDisplayModeInfo() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::clearDisplayModeInfo() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
    $this->container->get('entity_display.repository')->clearDisplayModeInfo();
    return $this;
  }

  /**
+2 −2
Changes for core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -453,8 +453,8 @@ public function testGetFormModeOptionsByBundle() {
   * @expectedDeprecation EntityManagerInterface::clearDisplayModeInfo() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::clearDisplayModeInfo() instead. See https://www.drupal.org/node/2549139.
   */
  public function testClearDisplayModeInfo() {
    $this->entityDisplayRepository->clearDisplayModeInfo()->shouldBeCalled()->willReturn([]);
    $this->entityManager->clearDisplayModeInfo();
    $this->entityDisplayRepository->clearDisplayModeInfo()->shouldBeCalled()->willReturn($this->entityDisplayRepository);
    $this->assertEquals($this->entityManager, $this->entityManager->clearDisplayModeInfo());
  }

  /**