function AccessPolicyProcessorTest::accountSwitcherProvider

Same name in other branches
  1. 10 core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php \Drupal\Tests\Core\Session\AccessPolicyProcessorTest::accountSwitcherProvider()

Data provider for testAccountSwitcher().

Return value

array A list of testAccountSwitcher method arguments.

File

core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php, line 223

Class

AccessPolicyProcessorTest
Tests the AccessPolicyProcessor service.

Namespace

Drupal\Tests\Core\Session

Code

public static function accountSwitcherProvider() {
    $cases['no-user-context-no-current-user'] = [
        'has_user_context' => FALSE,
        'is_current_user' => FALSE,
        'should_call_switcher' => FALSE,
    ];
    $cases['no-user-context-current-user'] = [
        'has_user_context' => FALSE,
        'is_current_user' => TRUE,
        'should_call_switcher' => FALSE,
    ];
    $cases['user-context-no-current-user'] = [
        'has_user_context' => TRUE,
        'is_current_user' => FALSE,
        'should_call_switcher' => TRUE,
    ];
    $cases['user-context-current-user'] = [
        'has_user_context' => TRUE,
        'is_current_user' => TRUE,
        'should_call_switcher' => FALSE,
    ];
    return $cases;
}

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