diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php index b933132..9c98de1 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php @@ -1355,6 +1355,24 @@ public function testGetEntityTypeFromClassAmbiguous() { } /** + * @covers ::getRouteProviders + */ + public function testGetRouteProviders() { + $apple = $this->getMock('Drupal\Core\Entity\EntityTypeInterface'); + $apple->expects($this->once()) + ->method('getRouteProviderClasses') + ->willReturn(['default' => 'Drupal\Tests\Core\Entity\TestRouteProvider']); + $this->setUpEntityManager(array( + 'apple' => $apple, + )); + + $apple_route_provider = $this->entityManager->getRouteProviders('apple'); + $this->assertInstanceOf('Drupal\Tests\Core\Entity\TestRouteProvider', $apple_route_provider['default']); + $this->assertAttributeInstanceOf('Drupal\Core\Extension\ModuleHandlerInterface', 'moduleHandler', $apple_route_provider['default']); + $this->assertAttributeInstanceOf('Drupal\Core\StringTranslation\TranslationInterface', 'stringTranslation', $apple_route_provider['default']); + } + + /** * Gets a mock controller class name. * * @return string @@ -1535,6 +1553,14 @@ public static function create(ContainerInterface $container) { } /** + * Provides a test entity route provider. + */ +class TestRouteProvider extends EntityHandlerBase { + +} + + +/** * Provides a test config entity storage for base field overrides. */ class TestConfigEntityStorage extends ConfigEntityStorage {