You are here

public function AuthenticationManagerTest::testApplyFilterWithFilterprovider in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php \Drupal\Tests\Core\Authentication\AuthenticationManagerTest::testApplyFilterWithFilterprovider()

@covers ::applyFilter

File

core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php, line 52
Contains \Drupal\Tests\Core\Authentication\AuthenticationManagerTest.

Class

AuthenticationManagerTest
@coversDefaultClass \Drupal\Core\Authentication\AuthenticationManager @group Authentication

Namespace

Drupal\Tests\Core\Authentication

Code

public function testApplyFilterWithFilterprovider() {
  $auth_provider = $this
    ->createMock('Drupal\\Tests\\Core\\Authentication\\TestAuthenticationProviderInterface');
  $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));
}