.../node/src/Tests/NodeTranslationUITest.php | 1 + core/modules/tracker/src/Tests/TrackerTest.php | 2 +- .../Tests/Core/Menu/LocalActionManagerTest.php | 27 ++++++++-------------- .../Tests/Core/Menu/LocalTaskManagerTest.php | 3 +-- 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/core/modules/node/src/Tests/NodeTranslationUITest.php b/core/modules/node/src/Tests/NodeTranslationUITest.php index c392750..013466c 100644 --- a/core/modules/node/src/Tests/NodeTranslationUITest.php +++ b/core/modules/node/src/Tests/NodeTranslationUITest.php @@ -28,6 +28,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase { 'languages:language_interface', 'theme', 'user.permissions', + 'route.name', 'route.menu_active_trails:account', 'route.menu_active_trails:footer', 'route.menu_active_trails:main', diff --git a/core/modules/tracker/src/Tests/TrackerTest.php b/core/modules/tracker/src/Tests/TrackerTest.php index 2666d5f..3c23a5a 100644 --- a/core/modules/tracker/src/Tests/TrackerTest.php +++ b/core/modules/tracker/src/Tests/TrackerTest.php @@ -79,7 +79,7 @@ function testTrackerAll() { $this->assertLink(t('My recent content'), 0, 'User tab shows up on the global tracker page.'); // Assert cache contexts, specifically the pager and node access contexts. - $this->assertCacheContexts(['languages:language_interface', 'route.name', 'theme', 'url.query_args.pagers:0', 'user.node_grants:view', 'user.permissions']); + $this->assertCacheContexts(['languages:language_interface', 'route.name', 'theme', 'url.query_args.pagers:0', 'user', 'user.node_grants:view']); // Assert cache tags for the visible node and node list cache tag. $additional_cache_tags = [ 'node_list', diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php index 8ed7ada..24a09f2 100644 --- a/core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php @@ -10,12 +10,12 @@ use Drupal\Component\Plugin\Discovery\DiscoveryInterface; use Drupal\Component\Plugin\Factory\FactoryInterface; use Drupal\Core\Access\AccessManagerInterface; +use Drupal\Core\Access\AccessResult; use Drupal\Core\Access\AccessResultForbidden; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Language\Language; use Drupal\Core\Menu\LocalActionManager; -use Drupal\Core\Render\RendererInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Routing\RouteProviderInterface; use Drupal\Core\Session\AccountInterface; @@ -95,13 +95,6 @@ class LocalActionManagerTest extends UnitTestCase { protected $discovery; /** - * The mocked renderer. - * - * @var \Drupal\Core\Render\RendererInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $renderer; - - /** * The tested local action manager * * @var \Drupal\Tests\Core\Menu\TestLocalActionManager @@ -127,9 +120,8 @@ protected function setUp() { $this->discovery = $this->getMock('Drupal\Component\Plugin\Discovery\DiscoveryInterface'); $this->factory = $this->getMock('Drupal\Component\Plugin\Factory\FactoryInterface'); $route_match = $this->getMock('Drupal\Core\Routing\RouteMatchInterface'); - $this->renderer = $this->getMock('Drupal\Core\Render\RendererInterface'); - $this->localActionManager = new TestLocalActionManager($this->controllerResolver, $this->request, $route_match, $this->routeProvider, $this->moduleHandler, $this->cacheBackend, $this->accessManager, $this->account, $this->discovery, $this->factory, $this->renderer); + $this->localActionManager = new TestLocalActionManager($this->controllerResolver, $this->request, $route_match, $this->routeProvider, $this->moduleHandler, $this->cacheBackend, $this->accessManager, $this->account, $this->discovery, $this->factory); } /** @@ -213,7 +205,7 @@ public function getActionsForRouteProvider() { 'url' => Url::fromRoute('test_route_2'), 'localized_options' => '', ), - '#access' => FALSE, + '#access' => AccessResult::forbidden(), '#weight' => 0, ), ), @@ -247,7 +239,7 @@ public function getActionsForRouteProvider() { 'url' => Url::fromRoute('test_route_2'), 'localized_options' => '', ), - '#access' => FALSE, + '#access' => AccessResult::forbidden(), '#weight' => 0, ), ), @@ -282,7 +274,7 @@ public function getActionsForRouteProvider() { 'url' => Url::fromRoute('test_route_2'), 'localized_options' => '', ), - '#access' => FALSE, + '#access' => AccessResult::forbidden(), '#weight' => 1, ), 'plugin_id_2' => array( @@ -292,7 +284,7 @@ public function getActionsForRouteProvider() { 'url' => Url::fromRoute('test_route_3'), 'localized_options' => '', ), - '#access' => FALSE, + '#access' => AccessResult::forbidden(), '#weight' => 0, ), ), @@ -329,7 +321,7 @@ public function getActionsForRouteProvider() { 'url' => Url::fromRoute('test_route_2', ['test1']), 'localized_options' => '', ), - '#access' => FALSE, + '#access' => AccessResult::forbidden(), '#weight' => 1, ), 'plugin_id_2' => array( @@ -339,7 +331,7 @@ public function getActionsForRouteProvider() { 'url' => Url::fromRoute('test_route_2', ['test2']), 'localized_options' => '', ), - '#access' => FALSE, + '#access' => AccessResult::forbidden(), '#weight' => 0, ), ), @@ -352,7 +344,7 @@ public function getActionsForRouteProvider() { class TestLocalActionManager extends LocalActionManager { - public function __construct(ControllerResolverInterface $controller_resolver, Request $request, RouteMatchInterface $route_match, RouteProviderInterface $route_provider, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, AccessManagerInterface $access_manager, AccountInterface $account, DiscoveryInterface $discovery, FactoryInterface $factory, RendererInterface $renderer) { + public function __construct(ControllerResolverInterface $controller_resolver, Request $request, RouteMatchInterface $route_match, RouteProviderInterface $route_provider, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, AccessManagerInterface $access_manager, AccountInterface $account, DiscoveryInterface $discovery, FactoryInterface $factory) { $this->discovery = $discovery; $this->factory = $factory; $this->routeProvider = $route_provider; @@ -363,7 +355,6 @@ public function __construct(ControllerResolverInterface $controller_resolver, Re $this->requestStack->push($request); $this->routeMatch = $route_match; $this->moduleHandler = $module_handler; - $this->renderer = $renderer; $this->alterInfo('menu_local_actions'); $this->setCacheBackend($cache_backend, 'local_action_plugins', array('local_action')); } diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php index a788d85..92b2b54 100644 --- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php @@ -250,8 +250,7 @@ protected function setupLocalTaskManager() { ->will($this->returnValue(new Language(array('id' => 'en')))); $account = $this->getMock('Drupal\Core\Session\AccountInterface'); - $renderer = $this->getMock('Drupal\Core\Render\RendererInterface'); - $this->manager = new LocalTaskManager($this->controllerResolver, $request_stack, $this->routeMatch, $this->routeProvider, $module_handler, $this->cacheBackend, $language_manager, $this->accessManager, $account, $renderer); + $this->manager = new LocalTaskManager($this->controllerResolver, $request_stack, $this->routeMatch, $this->routeProvider, $module_handler, $this->cacheBackend, $language_manager, $this->accessManager, $account); $property = new \ReflectionProperty('Drupal\Core\Menu\LocalTaskManager', 'discovery'); $property->setAccessible(TRUE);