function AuthenticationManagerTest::providerTestDefaultFilter

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

Provides data to self::testDefaultFilter().

File

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

Class

AuthenticationManagerTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Authentication%21AuthenticationManager.php/class/AuthenticationManager/8.9.x" title="Manager for authentication." class="local">\Drupal\Core\Authentication\AuthenticationManager</a> @group Authentication

Namespace

Drupal\Tests\Core\Authentication

Code

public function providerTestDefaultFilter() {
    $data = [];
    // No route, cookie is global, should apply.
    $data[] = [
        TRUE,
        FALSE,
        [],
        'cookie',
        TRUE,
    ];
    // No route, cookie is not global, should not apply.
    $data[] = [
        FALSE,
        FALSE,
        [],
        'cookie',
        FALSE,
    ];
    // Route, no _auth, cookie is global, should apply.
    $data[] = [
        TRUE,
        TRUE,
        [],
        'cookie',
        TRUE,
    ];
    // Route, no _auth, cookie is not global, should not apply.
    $data[] = [
        FALSE,
        TRUE,
        [],
        'cookie',
        FALSE,
    ];
    // Route, with _auth and non-matching provider, should not apply.
    $data[] = [
        FALSE,
        TRUE,
        [
            'basic_auth',
        ],
        'cookie',
        TRUE,
    ];
    // Route, with _auth and matching provider should not apply.
    $data[] = [
        TRUE,
        TRUE,
        [
            'basic_auth',
        ],
        'basic_auth',
        TRUE,
    ];
    return $data;
}

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