function AuthenticationManagerTest::testDefaultFilter
Tests default filter.
@legacy-covers ::defaultFilter @legacy-covers ::applyFilter
Attributes
#[DataProvider('providerTestDefaultFilter')]
File
-
core/
tests/ Drupal/ Tests/ Core/ Authentication/ AuthenticationManagerTest.php, line 32
Class
Namespace
Drupal\Tests\Core\AuthenticationCode
public function testDefaultFilter($applies, $has_route, $auth_option, $provider_id, $global) : void {
$auth_provider = $this->createMock('Drupal\\Core\\Authentication\\AuthenticationProviderInterface');
$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) {
$route = new Route('/example');
if ($auth_option) {
$route->setOption('_auth', $auth_option);
}
$request->attributes
->set(RouteObjectInterface::ROUTE_OBJECT, $route);
}
$this->assertSame($applies, $authentication_manager->appliesToRoutedRequest($request, FALSE));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.