diff --git a/core/lib/Drupal/Core/Authentication/AuthenticationManager.php b/core/lib/Drupal/Core/Authentication/AuthenticationManager.php index bb80c44..fda38e2 100644 --- a/core/lib/Drupal/Core/Authentication/AuthenticationManager.php +++ b/core/lib/Drupal/Core/Authentication/AuthenticationManager.php @@ -67,7 +67,7 @@ class AuthenticationManager implements AuthenticationProviderInterface, Authenti /** * {@inheritdoc} */ - public function addProvider(AuthenticationProviderInterface $provider, $id, $priority = 0, $global = FALSE) { + public function addProvider(AuthenticationProviderInterface $provider, $id, $priority = 0, $is_global = FALSE) { // Remove the 'authentication.' prefix from the provider ID. $id = substr($id, 15); @@ -83,7 +83,7 @@ public function addProvider(AuthenticationProviderInterface $provider, $id, $pri $this->challengers[$id] = $provider; } - if ($global) { + if ($is_global) { $this->globalProviders[$id] = TRUE; } } diff --git a/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php b/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php index 370cc8c..7ec92a2 100644 --- a/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php @@ -27,10 +27,10 @@ class AuthenticationManagerTest extends UnitTestCase { * * @dataProvider providerTestDefaultFilter */ - public function testDefaultFilter($applies, $has_route, $auth_option, $provider_id, $global_providers = ['cookie' => TRUE]) { - $authentication_manager = new AuthenticationManager($global_providers); + public function testDefaultFilter($applies, $has_route, $auth_option, $provider_id, $is_global) { + $authentication_manager = new AuthenticationManager(); $auth_provider = $this->getMock('Drupal\Core\Authentication\AuthenticationProviderInterface'); - $authentication_manager->addProvider($auth_provider, 'authentication.' . $provider_id); + $authentication_manager->addProvider($auth_provider, 'authentication.' . $provider_id, 0, $is_global); $request = new Request(); if ($has_route) { @@ -66,17 +66,17 @@ public function testApplyFilterWithFilterprovider() { public function providerTestDefaultFilter() { $data = []; // No route, cookie is global, should apply. - $data[] = [TRUE, FALSE, [], 'cookie']; + $data[] = [TRUE, FALSE, [], 'cookie', TRUE]; // No route, cookie is not global, should not apply. - $data[] = [FALSE, FALSE, [], 'cookie', ['other' => TRUE]]; + $data[] = [FALSE, FALSE, [], 'cookie', FALSE]; // Route, no _auth, cookie is global, should apply. - $data[] = [TRUE, TRUE, [], 'cookie']; + $data[] = [TRUE, TRUE, [], 'cookie', TRUE]; // Route, no _auth, cookie is not global, should not apply. - $data[] = [FALSE, TRUE, [], 'cookie', ['other' => TRUE]]; + $data[] = [FALSE, TRUE, [], 'cookie', FALSE]; // Route, with _auth and non-matching provider, should not apply. - $data[] = [FALSE, TRUE, ['basic_auth'], 'cookie']; + $data[] = [FALSE, TRUE, ['basic_auth'], 'cookie', TRUE]; // Route, with _auth and matching provider should not apply. - $data[] = [TRUE, TRUE, ['basic_auth'], 'basic_auth']; + $data[] = [TRUE, TRUE, ['basic_auth'], 'basic_auth', TRUE]; return $data; } diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php index 7d3d6a5..b3948fa 100644 --- a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php +++ b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php @@ -286,7 +286,7 @@ public function testProcessNoPriorityAndExtraArguments() { } /** - * Tests consumer method with extra parameters and no priority. + * Tests consumer method with priority, id and extra parameters. * * @covers ::process */