More updates to stop using dev or alpha or beta versions.
[yaffs-website] / web / core / tests / Drupal / Tests / Core / Entity / EntityUrlTest.php
index 8381ea7c64e2b07e93d4e2b6bd1ba0bdc8872004..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.
@@ -362,7 +362,9 @@ class EntityUrlTest extends UnitTestCase {
   public function providerTestToUrlUriCallback() {
     $test_cases = [];
 
-    $uri_callback = function () { return Url::fromRoute('<none>'); };
+    $uri_callback = function () {
+      return Url::fromRoute('<none>');
+    };
     $test_cases['uri_callback'] = [[], $uri_callback];
     $test_cases['bundle_uri_callback'] = [['uri_callback' => $uri_callback], NULL];
 
@@ -509,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
@@ -524,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;
   }
@@ -579,10 +581,9 @@ 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])
-    ;
+      ->willReturn([$this->entityTypeId => $bundle_info]);
   }
 
 }