VuFind API Documentation

IdentityRepositoryTest extends AbstractTokenRepositoryTestCase
in package

OAuth2 IdentityRepository tests.

Tags
category

VuFind

author

Ere Maijala ere.maijala@helsinki.fi

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Table of Contents

$accessTokenTable  : mixed
$oauth2Config  : array<string|int, mixed>
OAuth2 configuration
$userBirthDate  : string
User's birth date
getTestIdentityRepositoryData()  : array<string|int, mixed>
Data provider for testIdentityRepository
setUp()  : void
Setup tests
testIdentityRepository()  : void
Test identity repository
testIdentityRepositoryWithFailingILS()  : void
Test identity repository with a failing ILS connection
createAccessTokenRow()  : MockObject|AccessToken
Create AccessToken row
createClientEntity()  : ClientEntity
Create a client entity
createExpiryDateTime()  : DateTimeImmutable
Create an expiry datetime.
createTokenId()  : string
Create a token ID.
createUserRow()  : MockObject|User
Create User row
getAccessTokenRepository()  : AccessTokenRepository
Create AccessTokenRepository with mocks.
getAuthCodeRepository()  : AuthCodeRepository
Create AuthCodeRepository with mocks.
getCatUsernameHash()  : string
Create a hash from a user name
getMockAccessTokenService()  : MockObject|AccessTokenServiceInterface
Create Access token service
getMockAccessTokenTable()  : MockObject|AccessToken
Create AccessToken table
getMockFailingIlsConnection()  : MockObject|Connection
Get mock ILS connection that throws an exception for any actual ILS request.
getMockILSAuthenticator()  : ILSAuthenticator
Get a mock ILSAuthenticator
getMockIlsConnection()  : MockObject|Connection
Get mock ILS connection.
getMockUser()  : MockObject|UserEntityInterface
Get a mock user object
getMockUserService()  : MockObject|UserServiceInterface
Create a mock user service that returns a fake user object.
getMockUserTable()  : MockObject|User
Create User table
getOAuth2Config()  : array<string|int, mixed>
Create OAuth2 Config
getRefreshTokenRepository()  : RefreshTokenRepository
Create RefreshTokenRepository with mocks.

Properties

$oauth2Config

OAuth2 configuration

protected array<string|int, mixed> $oauth2Config = ['Server' => ['userIdentifierField' => 'id', 'encryptionKey' => 'testkey', 'hashSalt' => 'superSalty'], 'ClaimMappings' => ['id' => 'id', 'sub' => 'id', 'nonce' => 'nonce', 'name' => 'full_name', 'given_name' => 'firstname', 'family_name' => 'lastname', 'email' => 'email', 'age' => 'age', 'birthdate' => 'birthdate', 'locale' => 'last_language', 'phone' => 'phone', 'address' => 'address_json', 'block_status' => 'block_status', 'library_user_id' => 'library_user_id_hash']]

Methods

getTestIdentityRepositoryData()

Data provider for testIdentityRepository

public static getTestIdentityRepositoryData() : array<string|int, mixed>
Return values
array<string|int, mixed>

testIdentityRepository()

Test identity repository

public testIdentityRepository(bool|null $blocks) : void
Parameters
$blocks : bool|null

Blocks status

Tags
dataProvider

getTestIdentityRepositoryData

Return values
void

testIdentityRepositoryWithFailingILS()

Test identity repository with a failing ILS connection

public testIdentityRepositoryWithFailingILS() : void
Return values
void

createExpiryDateTime()

Create an expiry datetime.

protected createExpiryDateTime() : DateTimeImmutable
Return values
DateTimeImmutable

createTokenId()

Create a token ID.

protected createTokenId() : string

Follows OAuth2 server's generateUniqueIdentifier.

Return values
string

createUserRow()

Create User row

protected createUserRow(array<string|int, mixed> $data) : MockObject|User
Parameters
$data : array<string|int, mixed>

Row data

Return values
MockObject|User

getCatUsernameHash()

Create a hash from a user name

protected getCatUsernameHash(string $username) : string
Parameters
$username : string

User name

Return values
string

getMockFailingIlsConnection()

Get mock ILS connection that throws an exception for any actual ILS request.

protected getMockFailingIlsConnection() : MockObject|Connection
Return values
MockObject|Connection

getMockIlsConnection()

Get mock ILS connection.

protected getMockIlsConnection(bool|null $blocks) : MockObject|Connection
Parameters
$blocks : bool|null

Whether to support blocks and what to return

Return values
MockObject|Connection

getOAuth2Config()

Create OAuth2 Config

protected getOAuth2Config() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results