function AuthenticationManagerTest::testApplyFilterWithFilterProvider

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

Tests apply filter with filter provider.

File

core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php, line 54

Class

AuthenticationManagerTest
Tests Drupal\Core\Authentication\AuthenticationManager.

Namespace

Drupal\Tests\Core\Authentication

Code

public function testApplyFilterWithFilterProvider() : void {
  $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));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.