diff --git a/core/modules/views/src/ViewExecutableFactory.php b/core/modules/views/src/ViewExecutableFactory.php index 52e527c..8f9a479 100644 --- a/core/modules/views/src/ViewExecutableFactory.php +++ b/core/modules/views/src/ViewExecutableFactory.php @@ -40,6 +40,13 @@ class ViewExecutableFactory { protected $viewsData; /** + * The route provider. + * + * @var \Drupal\Core\Routing\RouteProviderInterface + */ + protected $routeProvider; + + /** * The global token utility. * * @var \Drupal\Core\Utility\Token @@ -78,7 +85,7 @@ public function __construct(AccountInterface $user, RequestStack $request_stack, * A ViewExecutable instance. */ public function get(ViewEntityInterface $view) { - $view = new ViewExecutable($view, $this->user, $this->viewsData, $this->tokenUtility); + $view = new ViewExecutable($view, $this->user, $this->viewsData, $this->routeProvider, $this->tokenUtility); $view->setRequest($this->requestStack->getCurrentRequest()); return $view; } diff --git a/core/modules/views/tests/src/Unit/ViewExecutableFactoryTest.php b/core/modules/views/tests/src/Unit/ViewExecutableFactoryTest.php index c9788ae..4b73fe2 100644 --- a/core/modules/views/tests/src/Unit/ViewExecutableFactoryTest.php +++ b/core/modules/views/tests/src/Unit/ViewExecutableFactoryTest.php @@ -54,6 +54,13 @@ class ViewExecutableFactoryTest extends UnitTestCase { protected $viewsData; /** + * The mocked route provider. + * + * @var \Drupal\Core\Routing\RouteProviderInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $routeProvider; + + /** * The global token utility. * * @var \Drupal\Core\Utility\Token @@ -75,7 +82,8 @@ protected function setUp() { $this->tokenUtility = $this->getMockBuilder('Drupal\Core\Utility\Token') ->disableOriginalConstructor() ->getMock(); - $this->viewExecutableFactory = new ViewExecutableFactory($this->user, $this->requestStack, $this->viewsData, $this->tokenUtility); + $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface'); + $this->viewExecutableFactory = new ViewExecutableFactory($this->user, $this->requestStack, $this->viewsData, $this->routeProvider, $this->tokenUtility); } /** diff --git a/core/modules/views/tests/src/Unit/ViewExecutableTest.php b/core/modules/views/tests/src/Unit/ViewExecutableTest.php index b0d2ec0..edb9725 100644 --- a/core/modules/views/tests/src/Unit/ViewExecutableTest.php +++ b/core/modules/views/tests/src/Unit/ViewExecutableTest.php @@ -77,6 +77,13 @@ class ViewExecutableTest extends UnitTestCase { protected $routeProvider; /** + * The global token utility. + * + * @var \Drupal\Core\Utility\Token + */ + protected $tokenUtility; + + /** * {@inheritdoc} */ protected function setUp() { @@ -94,8 +101,11 @@ protected function setUp() { $this->displayHandlers = $this->getMockBuilder('Drupal\views\DisplayPluginCollection') ->disableOriginalConstructor() ->getMock(); + $this->tokenUtility = $this->getMockBuilder('Drupal\Core\Utility\Token') + ->disableOriginalConstructor() + ->getMock(); - $this->executable = new ViewExecutable($this->view, $this->user, $this->viewsData, $this->routeProvider); + $this->executable = new ViewExecutable($this->view, $this->user, $this->viewsData, $this->routeProvider, $this->tokenUtility); $this->executable->display_handler = $this->displayHandler; $this->executable->displayHandlers = $this->displayHandlers; @@ -448,10 +458,7 @@ protected function setupBaseViewAndDisplay() { ); $storage = new View($config, 'view'); - $token_utility = $this->getMockBuilder('Drupal\Core\Utility\Token') - ->disableOriginalConstructor() - ->getMock(); - $view = new ViewExecutable($storage, $this->user, $this->viewsData, $token_utility); + $view = new ViewExecutable($storage, $this->user, $this->viewsData, $this->routeProvider, $this->tokenUtility); $display = $this->getMockBuilder('Drupal\views\Plugin\views\display\DisplayPluginBase') ->disableOriginalConstructor() ->getMock();