Skip to content

Commit

Permalink
Issue #2605904 by jmikii, swatichouhan012, kishor_kolekar, willzyx, v…
Browse files Browse the repository at this point in the history
…acho, Berdir, alexpott: Missing return statement in EntityManager::clearDisplayModeInfo()
  • Loading branch information
alexpott committed Mar 12, 2020
1 parent 51bd322 commit 6fd8f34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/Drupal/Core/Entity/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Drupal/Tests/Core/Entity/EntityManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

/**
Expand Down

0 comments on commit 6fd8f34

Please sign in to comment.