Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / tests / Drupal / Tests / Core / Entity / EntityUrlTest.php
index f1c4ca8ec9fa2d2bb38f248ea5b896a4f7202b73..cf0f93f87f3c7dcc95110f4933f1f608ea9a31ad 100644 (file)
@@ -4,7 +4,7 @@ namespace Drupal\Tests\Core\Entity;
 
 use Drupal\Core\Entity\Entity;
 use Drupal\Core\Entity\EntityMalformedException;
-use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\Exception\UndefinedLinkTemplateException;
 use Drupal\Core\Entity\RevisionableInterface;
@@ -21,11 +21,11 @@ use Drupal\Tests\UnitTestCase;
 class EntityUrlTest extends UnitTestCase {
 
   /**
-   * The entity manager mock used in this test.
+   * The entity type bundle info service mock used in this test.
    *
-   * @var \Prophecy\Prophecy\ProphecyInterface|\Drupal\Core\Entity\EntityManagerInterface
+   * @var \Prophecy\Prophecy\ProphecyInterface|\Drupal\Core\Entity\EntityTypeBundleInfoInterface
    */
-  protected $entityManager;
+  protected $entityTypeBundleInfo;
 
   /**
    * The ID of the entity type used in this test.
@@ -511,7 +511,7 @@ class EntityUrlTest extends UnitTestCase {
    * @return \Drupal\Core\Entity\Entity|\PHPUnit_Framework_MockObject_MockObject
    */
   protected function getEntity($class, array $values, array $methods = []) {
-    $methods = array_merge($methods, ['getEntityType', 'entityManager']);
+    $methods = array_merge($methods, ['getEntityType', 'entityManager', 'entityTypeBundleInfo']);
 
     // Prophecy does not allow prophesizing abstract classes while actually
     // calling their code. We use Prophecy below because that allows us to
@@ -526,8 +526,8 @@ class EntityUrlTest extends UnitTestCase {
     $this->entityType->getKey('langcode')->willReturn(FALSE);
     $entity->method('getEntityType')->willReturn($this->entityType->reveal());
 
-    $this->entityManager = $this->prophesize(EntityManagerInterface::class);
-    $entity->method('entityManager')->willReturn($this->entityManager->reveal());
+    $this->entityTypeBundleInfo = $this->prophesize(EntityTypeBundleInfoInterface::class);
+    $entity->method('entityTypeBundleInfo')->willReturn($this->entityTypeBundleInfo->reveal());
 
     return $entity;
   }
@@ -581,7 +581,7 @@ class EntityUrlTest extends UnitTestCase {
    *   The bundle information to register.
    */
   protected function registerBundleInfo($bundle_info) {
-    $this->entityManager
+    $this->entityTypeBundleInfo
       ->getBundleInfo($this->entityTypeId)
       ->willReturn([$this->entityTypeId => $bundle_info]);
   }