diff --git a/core/lib/Drupal/Core/Authentication/AuthenticationCollector.php b/core/lib/Drupal/Core/Authentication/AuthenticationCollector.php index 0e0d7f5..e417f50 100644 --- a/core/lib/Drupal/Core/Authentication/AuthenticationCollector.php +++ b/core/lib/Drupal/Core/Authentication/AuthenticationCollector.php @@ -1,9 +1,12 @@ sortedProviders; } + } diff --git a/core/lib/Drupal/Core/Authentication/AuthenticationCollectorInterface.php b/core/lib/Drupal/Core/Authentication/AuthenticationCollectorInterface.php index 7a8e208..76b7fd2 100644 --- a/core/lib/Drupal/Core/Authentication/AuthenticationCollectorInterface.php +++ b/core/lib/Drupal/Core/Authentication/AuthenticationCollectorInterface.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\Core\Authentication\AuthenticationCollectorInterface + * Contains \Drupal\Core\Authentication\AuthenticationCollectorInterface. */ namespace Drupal\Core\Authentication; @@ -31,6 +31,7 @@ public function addProvider(AuthenticationProviderInterface $provider, $provider * Returns whether a provider is considered global. * * @return bool + * TRUE if the provider is global, FALSE otherwise. * * @see \Drupal\Core\Authentication\AuthenticationCollectorInterface::addProvider */ @@ -57,4 +58,5 @@ public function getProvider($provider_id); * An array of authentication provider objects. */ public function getSortedProviders(); + } diff --git a/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php b/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php index da7331d..315d5d6 100644 --- a/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php @@ -7,6 +7,7 @@ namespace Drupal\Tests\Core\Authentication; +use Drupal\Core\Authentication\AuthenticationCollector; use Drupal\Core\Authentication\AuthenticationManager; use Drupal\Core\Authentication\AuthenticationProviderFilterInterface; use Drupal\Core\Authentication\AuthenticationProviderInterface; @@ -28,9 +29,10 @@ class AuthenticationManagerTest extends UnitTestCase { * @dataProvider providerTestDefaultFilter */ public function testDefaultFilter($applies, $has_route, $auth_option, $provider_id, $global) { - $authentication_manager = new AuthenticationManager(); $auth_provider = $this->getMock('Drupal\Core\Authentication\AuthenticationProviderInterface'); - $authentication_manager->addProvider($auth_provider, $provider_id, 0, $global); + $auth_collector = new AuthenticationCollector(); + $auth_collector->addProvider($auth_provider, $provider_id, 0, $global); + $authentication_manager = new AuthenticationManager($auth_collector); $request = new Request(); if ($has_route) { @@ -48,14 +50,16 @@ public function testDefaultFilter($applies, $has_route, $auth_option, $provider_ * @covers ::applyFilter */ public function testApplyFilterWithFilterprovider() { - $authentication_manager = new AuthenticationManager(); $auth_provider = $this->getMock('Drupal\Tests\Core\Authentication\TestAuthenticationProviderInterface'); - $authentication_manager->addProvider($auth_provider, 'filtered', 0); - $auth_provider->expects($this->once()) ->method('appliesToRoutedRequest') ->willReturn(TRUE); + $authentication_collector = new AuthenticationCollector(); + $authentication_collector->addProvider($auth_provider, 'filtered', 0); + + $authentication_manager = new AuthenticationManager($authentication_collector); + $request = new Request(); $this->assertTrue($authentication_manager->appliesToRoutedRequest($request, FALSE)); }