From 86719fc9e6de03887ba9f4aeb823b8b8d1f913f6 Mon Sep 17 00:00:00 2001 From: Lee Rowlands <lee.rowlands@previousnext.com.au> Date: Wed, 14 Aug 2019 10:44:35 +1000 Subject: [PATCH] Issue #3074632 by mikelutz: The second argument to $container->register should be a class name string, not an object in AccessManagerTest --- core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php b/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php index 1eb3d97121af..efd838d53511 100644 --- a/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php @@ -303,8 +303,7 @@ public function providerTestCheckConjunctions() { */ public function testCheckConjunctions($name, $condition_one, $condition_two, $expected_access) { $this->setupAccessChecker(); - $access_check = new DefinedTestAccessCheck(); - $this->container->register('test_access_defined', $access_check); + $this->container->register('test_access_defined', DefinedTestAccessCheck::class); $this->checkProvider->addCheckService('test_access_defined', 'access', ['_test_access']); $route_collection = new RouteCollection(); @@ -536,8 +535,7 @@ public function providerCheckException() { * Adds a default access check service to the container and the access manager. */ protected function setupAccessChecker() { - $access_check = new DefaultAccessCheck(); - $this->container->register('test_access_default', $access_check); + $this->container->register('test_access_default', DefaultAccessCheck::class); $this->checkProvider->addCheckService('test_access_default', 'access', ['_access']); } -- GitLab