You are here

public function OpenIDConnectTest::dataProviderForHasSetPasswordAccess in OpenID Connect / OAuth client 2.x

Same name and namespace in other branches
  1. 8 tests/src/Unit/OpenIDConnectTest.php \Drupal\Tests\openid_connect\Unit\OpenIDConnectTest::dataProviderForHasSetPasswordAccess()

Data provider for the testHasSetPasswordAccess method.

Return value

array|array[] Data provider parameters for the testHasSetPassword() method.

File

tests/src/Unit/OpenIDConnectTest.php, line 350

Class

OpenIDConnectTest
Provides tests for the OpenID Connect module.

Namespace

Drupal\Tests\openid_connect\Unit

Code

public function dataProviderForHasSetPasswordAccess() : array {
  $connectedAccounts = [
    $this
      ->randomMachineName() => 'sub',
  ];
  return [
    [
      $this->currentUser,
      FALSE,
      [],
      TRUE,
    ],
    [
      $this->currentUser,
      TRUE,
      [],
      TRUE,
    ],
    [
      NULL,
      TRUE,
      [],
      TRUE,
    ],
    [
      NULL,
      FALSE,
      [],
      TRUE,
    ],
    [
      $this->currentUser,
      FALSE,
      $connectedAccounts,
      FALSE,
    ],
    [
      $this->currentUser,
      TRUE,
      $connectedAccounts,
      TRUE,
    ],
    [
      NULL,
      TRUE,
      $connectedAccounts,
      TRUE,
    ],
    [
      NULL,
      FALSE,
      $connectedAccounts,
      FALSE,
    ],
  ];
}