You are here

public function AuthenticationManagerTest::providerTestDefaultFilter 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::providerTestDefaultFilter()

Provides data to self::testDefaultFilter().

File

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

Class

AuthenticationManagerTest
@coversDefaultClass \Drupal\Core\Authentication\AuthenticationManager @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;
}