diff --git a/core/core.services.yml b/core/core.services.yml index 1d4d172..cf508df 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -323,7 +323,7 @@ services: - [setContext, ['@?router.request_context']] link_generator: class: Drupal\Core\Utility\LinkGenerator - arguments: ['@url_generator', '@module_handler', '@path.alias_manager.cached'] + arguments: ['@url_generator', '@module_handler'] router.dynamic: class: Symfony\Cmf\Component\Routing\DynamicRouter arguments: ['@router.request_context', '@router.matcher', '@url_generator'] diff --git a/core/lib/Drupal/Core/Utility/LinkGenerator.php b/core/lib/Drupal/Core/Utility/LinkGenerator.php index 551fc56..f8a2f90 100644 --- a/core/lib/Drupal/Core/Utility/LinkGenerator.php +++ b/core/lib/Drupal/Core/Utility/LinkGenerator.php @@ -35,26 +35,16 @@ class LinkGenerator implements LinkGeneratorInterface { protected $moduleHandler; /** - * The path alias manager. - * - * @var \Drupal\Core\Path\AliasManagerInterface - */ - protected $aliasManager; - - /** * Constructs a LinkGenerator instance. * * @param \Drupal\Core\Routing\UrlGeneratorInterface $url_generator * The url generator. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. - * @param \Drupal\Core\Path\AliasManagerInterface $alias_manager - * The path alias manager. */ - public function __construct(UrlGeneratorInterface $url_generator, ModuleHandlerInterface $module_handler, AliasManagerInterface $alias_manager) { + public function __construct(UrlGeneratorInterface $url_generator, ModuleHandlerInterface $module_handler) { $this->urlGenerator = $url_generator; $this->moduleHandler = $module_handler; - $this->aliasManager = $alias_manager; } /** diff --git a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php index 07edbc7..55f4339 100644 --- a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php +++ b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php @@ -43,13 +43,6 @@ class LinkGeneratorTest extends UnitTestCase { protected $moduleHandler; /** - * The mocked path alias manager. - * - * @var \Drupal\Core\Path\AliasManagerInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $aliasManager; - - /** * Contains the LinkGenerator default options. */ protected $defaultOptions = array( @@ -80,9 +73,8 @@ protected function setUp() { $this->urlGenerator = $this->getMock('\Drupal\Core\Routing\UrlGenerator', array(), array(), '', FALSE); $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'); - $this->aliasManager = $this->getMock('\Drupal\Core\Path\AliasManagerInterface'); - $this->linkGenerator = new LinkGenerator($this->urlGenerator, $this->moduleHandler, $this->aliasManager); + $this->linkGenerator = new LinkGenerator($this->urlGenerator, $this->moduleHandler); } /** @@ -344,14 +336,6 @@ public function testGenerateActive() { array('test_route_4', array('object' => '1'), 'test-route-4/1'), ))); - $this->aliasManager->expects($this->exactly(7)) - ->method('getSystemPath') - ->will($this->returnValueMap(array( - array('test-route-1', NULL, 'test-route-1'), - array('test-route-3', NULL, 'test-route-3'), - array('test-route-4/1', NULL, 'test-route-4/1'), - ))); - $this->moduleHandler->expects($this->exactly(8)) ->method('alter');