function AuthenticationManagerTest::testApplyFilterWithFilterProvider

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php \Drupal\Tests\Core\Authentication\AuthenticationManagerTest::testApplyFilterWithFilterprovider()
  2. 10 core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php \Drupal\Tests\Core\Authentication\AuthenticationManagerTest::testApplyFilterWithFilterProvider()
  3. 11.x 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

Class

AuthenticationManagerTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Authentication%21AuthenticationManager.php/class/AuthenticationManager/9" title="Manager for authentication." class="local">\Drupal\Core\Authentication\AuthenticationManager</a> @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));
}

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