MultiILSTest
extends TestCase
in package
Uses
ConfigPluginManagerTrait
MultiILS authentication test class.
Tags
Table of Contents
- $container : MockContainer
- Container for building mocks.
- setUp() : void
- Standard setup method.
- testBadLoginResponse() : void
- Test login with technical error.
- testCreateIsDisallowed() : void
- Test account creation is disallowed.
- testLogin() : void
- Test successful login.
- testLoginWithBlankPassword() : void
- Test login with blank password.
- testLoginWithBlankUsername() : void
- Test login with blank username.
- testLoginWithEmptyTarget() : void
- Test login with empty invalid target.
- testLoginWithInvalidTarget() : void
- Test login with invalid target.
- testLoginWithMissingCatId() : void
- Test failure caused by missing cat_id.
- getLoginRequest() : Request
- Support method -- get parameters to log into an account (but allow override of individual parameters so we can test different scenarios).
- getMockConfigPluginManager() : MockObject|PluginManager
- Get a mock configuration plugin manager with the given configuration "files" available.
- getMockFailingConfigPluginManager() : MockObject|PluginManager
- Get a mock configuration plugin manager that will throw an exception.
- getMockILSAuthenticator() : MockObject|ILSAuthenticator
- Get mock ILS authenticator
- getMockMultiBackend() : MockObject|MultiBackend
- Get a mock MultiBackend driver to test.
- getMockUser() : MockObject|UserEntityInterface
- Get a mock UserEntityInterface.
- getMultiILS() : MultiILS
- Get the object to test.
Properties
$container
Container for building mocks.
protected
MockContainer
$container
Methods
setUp()
Standard setup method.
public
setUp() : void
Return values
void —testBadLoginResponse()
Test login with technical error.
public
testBadLoginResponse() : void
Return values
void —testCreateIsDisallowed()
Test account creation is disallowed.
public
testCreateIsDisallowed() : void
Return values
void —testLogin()
Test successful login.
public
testLogin() : void
Return values
void —testLoginWithBlankPassword()
Test login with blank password.
public
testLoginWithBlankPassword() : void
Return values
void —testLoginWithBlankUsername()
Test login with blank username.
public
testLoginWithBlankUsername() : void
Return values
void —testLoginWithEmptyTarget()
Test login with empty invalid target.
public
testLoginWithEmptyTarget() : void
Return values
void —testLoginWithInvalidTarget()
Test login with invalid target.
public
testLoginWithInvalidTarget() : void
Return values
void —testLoginWithMissingCatId()
Test failure caused by missing cat_id.
public
testLoginWithMissingCatId() : void
Return values
void —getLoginRequest()
Support method -- get parameters to log into an account (but allow override of individual parameters so we can test different scenarios).
protected
getLoginRequest([array<string|int, mixed> $overrides = [] ]) : Request
Parameters
- $overrides : array<string|int, mixed> = []
-
Associative array of parameters to override.
Return values
Request —getMockConfigPluginManager()
Get a mock configuration plugin manager with the given configuration "files" available.
protected
getMockConfigPluginManager(array<string|int, mixed> $configs[, array<string|int, mixed> $default = [] ][, InvocationOrder|null $getExpect = null ][, InvocationOrder|null $hasExpect = null ]) : MockObject|PluginManager
Parameters
- $configs : array<string|int, mixed>
-
An associative array of configurations where key is the file (e.g. 'config') and value an array of configuration sections and directives
- $default : array<string|int, mixed> = []
-
Default configuration to return when no entry is found in $configs
- $getExpect : InvocationOrder|null = null
-
The expected invocation order for the get() method (null for any)
- $hasExpect : InvocationOrder|null = null
-
The expected invocation order for the has() method (null for any)
Return values
MockObject|PluginManager —getMockFailingConfigPluginManager()
Get a mock configuration plugin manager that will throw an exception.
protected
getMockFailingConfigPluginManager(Throwable $exception) : MockObject|PluginManager
Parameters
- $exception : Throwable
-
Exception to throw
Return values
MockObject|PluginManager —getMockILSAuthenticator()
Get mock ILS authenticator
protected
getMockILSAuthenticator([array<string|int, mixed> $patron = null ]) : MockObject|ILSAuthenticator
Parameters
- $patron : array<string|int, mixed> = null
-
Logged in patron to simulate (null for none).
Return values
MockObject|ILSAuthenticator —getMockMultiBackend()
Get a mock MultiBackend driver to test.
protected
getMockMultiBackend([array<string|int, mixed> $onlyMethods = [] ][, array<string|int, mixed> $addMethods = ['patronLogin'] ]) : MockObject|MultiBackend
Parameters
- $onlyMethods : array<string|int, mixed> = []
-
Existing methods to mock (in addition to supportsMethod)
- $addMethods : array<string|int, mixed> = ['patronLogin']
-
New methods to mock (in addition to getLoginDrivers)
Return values
MockObject|MultiBackend —getMockUser()
Get a mock UserEntityInterface.
protected
getMockUser() : MockObject|UserEntityInterface
Return values
MockObject|UserEntityInterface —getMultiILS()
Get the object to test.
protected
getMultiILS([MultiBackend|null $driver = null ][, array<string|int, mixed>|null $patron = null ][, UserEntityInterface|null $mockUser = null ]) : MultiILS
Parameters
- $driver : MultiBackend|null = null
-
Mock MultiBackend driver to test with.
- $patron : array<string|int, mixed>|null = null
-
Logged in patron for mock authenticator (null for none)
- $mockUser : UserEntityInterface|null = null
-
Mock user object (null for default)