MultiBackendTest
extends AbstractMultiDriverTestCase
in package
ILS driver test
Tags
Table of Contents
- testAddIdPrefixes() : void
- Testing method for addIdPrefixes
- testCancelHolds() : void
- Testing method for cancelHolds
- testCancelILLRequests() : void
- Testing method for cancelILLRequests
- testCancelStorageRetrievalRequests() : void
- Testing method for cancelStorageRetrievalRequests
- testCheckILLRequestIsValid() : void
- Testing method for checkILLRequestIsValid
- testCheckRequestIsValid() : void
- Testing method for checkRequestIsValid
- testCheckStorageRetrievalRequestIsValid() : void
- Testing method for checkStorageRetrievalRequestIsValid
- testDefaultDriver() : void
- Test that MultiBackend can find and use the default ILS driver if parameters don't include a detectable source id
- testDriverSupportsMethod() : void
- Testing method for driverSupportsMethod
- testFindReserves() : void
- Testing method for findReserves
- testFindReservesNoDefault() : void
- Testing method for findReserves without a default driver
- testGetAccountBlocks() : void
- Testing method for getAccountBlocks
- testGetCancelHoldDetails() : void
- Testing method for getCancelHoldDetails
- testGetCancelILLRequestDetails() : void
- Testing method for getCancelILLRequestDetails
- testGetCancelStorageRetrievalRequestDetails() : void
- Testing method for getCancelStorageRetrievalRequestDetails
- testGetConfig() : void
- Testing method for getConfig
- testGetCourses() : void
- Testing method for getCourses with a default driver
- testGetCoursesNoDefault() : void
- Testing method for getCourses without a default driver
- testGetDefaultLoginDriver() : void
- Testing method for getDefaultLoginDriver
- testGetDefaultPickUpLocation() : void
- Testing method for getDefaultPickUpLocation
- testGetDefaultRequestGroup() : void
- Testing method for getDefaultRequestGroup
- testGetDepartments() : void
- Testing method for getDepartments
- testGetDepartmentsNoDefault() : void
- Testing method for getDepartments without a default driver
- testGetDriver() : void
- Test that MultiBackend can properly retrieve a new driver.
- testGetDriverConfig() : void
- Tests that getDriverConfig works correctly
- testGetHolding() : void
- Testing method for getHolding
- testGetHoldLink() : void
- Testing method for getHoldLink
- testGetILLPickupLibraries() : void
- Testing method for getILLPickupLibraries
- testGetILLPickupLocations() : void
- Testing method for getILLPickupLocations
- testGetInstructors() : void
- Testing method for getInstructors
- testGetInstructorsNoDefault() : void
- Testing method for getInstructors without a default driver
- testGetLocalId() : mixed
- This method tests getLocalId.
- testGetLoginDrivers() : void
- Testing method for getLoginDrivers
- testGetMyFines() : void
- Testing method for getMyFines
- testGetMyHolds() : void
- Testing method for getMyHolds
- testGetMyILLRequests() : void
- Testing method for getMyILLRequests
- testGetMyProfile() : void
- Testing method for getMyProfile
- testGetMyStorageRetrievalRequests() : void
- Testing method for getMyStorageRetrievalRequests
- testGetMyTransactions() : void
- Testing method for getMyTransactions
- testGetNewItems() : void
- Testing method for getNewItems with a default driver
- testGetNewItemsNoDefault() : void
- Testing method for getNewItems without a default driver
- testGetPickUpLocations() : void
- Testing method for getPickUpLocations
- testGetPurchaseHistory() : void
- Testing method for getPurchaseHistory
- testGetRenewDetails() : void
- Testing method for getRenewDetails
- testGetRequestBlocks() : void
- Testing method for getRequestBlocks
- testGetRequestGroups() : void
- Testing method for getRequestGroups
- testGetSourceFromParams() : void
- Testing method for getSourceFromParams
- testGetStatus() : void
- Testing method for getStatus
- testGetStatuses() : void
- Testing method for getStatuses
- testILSConfigurationPathWithDriverConfigPath() : void
- Test that driver handles ILS driver configuration loading properly when drivers_config_path is defined.
- testILSConfigurationPathWithoutDriverConfigPath() : void
- Test that driver handles ILS driver configuration loading properly when drivers_config_path is not defined.
- testInitialization() : void
- Test that the driver can be properly initialized.
- testLogging() : void
- Tests that logging works correctly
- testMissingConfiguration() : void
- Test that driver complains about missing configuration.
- testMissingILSConfiguration() : void
- Test that driver handles missing ILS driver configuration properly.
- testPatronLogin() : void
- Test that MultiBackend can properly find a driver and pass log in credentials to it
- testPlaceHold() : void
- Testing method for placeHold
- testPlaceILLRequest() : void
- Testing method for placeILLRequest
- testPlaceStorageRetrievalRequest() : void
- Testing method for placeStorageRetrievalRequest
- testRenewMyItems() : void
- Testing method for renewMyItems
- testStripIdPrefixes() : void
- Testing method for stripIdPrefixes
- testSupportsMethod() : void
- Test that MultiBackend can properly tell whether or not a driver is has contains a specified method.
- callMethod() : mixed
- Call protected or private method for side-effect and result.
- getDriver() : mixed
- Method to get a raw MultiBackend Driver instance.
- getMockConfigPluginManager() : MockObject|PluginManager
- Get a mock configuration plugin manager with the given configuration "files" available.
- getMockDemoDriver() : Demo
- Get a mock Demo driver
- getMockFailingConfigPluginManager() : MockObject|PluginManager
- Get a mock configuration plugin manager that will throw an exception.
- getMockILS() : AbstractBase
- Get a mock driver
- getMockILSAuthenticator() : ILSAuthenticator
- Get a mock ILS authenticator
- getMockSM() : object
- This function returns a mock service manager with the given parameters For examples of what is to be passed, see: http://www.phpunit.de/manual/3.0/en/mock-objects.html
- getMultiDriverForDrivers() : AbstractMultiDriver
- Create a Multi Driver for the given ILS drivers
- getPatron() : array<string|int, mixed>
- Method to get a patron with the given username
- getProperty() : mixed
- Return protected or private property.
- initDriver() : mixed
- Method to get an initialized MultiBackend Driver.
- initSimpleMethodTest() : object
- Initialize a MultiBackend driver for a simple method test with three drivers: Voyager, Demo and Dummy that doesn't handle anything
- setProperty() : void
- Set protected or private property.
Methods
testAddIdPrefixes()
Testing method for addIdPrefixes
public
testAddIdPrefixes() : void
Return values
void —testCancelHolds()
Testing method for cancelHolds
public
testCancelHolds() : void
Return values
void —testCancelILLRequests()
Testing method for cancelILLRequests
public
testCancelILLRequests() : void
Return values
void —testCancelStorageRetrievalRequests()
Testing method for cancelStorageRetrievalRequests
public
testCancelStorageRetrievalRequests() : void
Return values
void —testCheckILLRequestIsValid()
Testing method for checkILLRequestIsValid
public
testCheckILLRequestIsValid() : void
Return values
void —testCheckRequestIsValid()
Testing method for checkRequestIsValid
public
testCheckRequestIsValid() : void
Return values
void —testCheckStorageRetrievalRequestIsValid()
Testing method for checkStorageRetrievalRequestIsValid
public
testCheckStorageRetrievalRequestIsValid() : void
Return values
void —testDefaultDriver()
Test that MultiBackend can find and use the default ILS driver if parameters don't include a detectable source id
public
testDefaultDriver() : void
Return values
void —testDriverSupportsMethod()
Testing method for driverSupportsMethod
public
testDriverSupportsMethod() : void
Return values
void —testFindReserves()
Testing method for findReserves
public
testFindReserves() : void
Return values
void —testFindReservesNoDefault()
Testing method for findReserves without a default driver
public
testFindReservesNoDefault() : void
Return values
void —testGetAccountBlocks()
Testing method for getAccountBlocks
public
testGetAccountBlocks() : void
Return values
void —testGetCancelHoldDetails()
Testing method for getCancelHoldDetails
public
testGetCancelHoldDetails() : void
Return values
void —testGetCancelILLRequestDetails()
Testing method for getCancelILLRequestDetails
public
testGetCancelILLRequestDetails() : void
Return values
void —testGetCancelStorageRetrievalRequestDetails()
Testing method for getCancelStorageRetrievalRequestDetails
public
testGetCancelStorageRetrievalRequestDetails() : void
Return values
void —testGetConfig()
Testing method for getConfig
public
testGetConfig() : void
Return values
void —testGetCourses()
Testing method for getCourses with a default driver
public
testGetCourses() : void
Return values
void —testGetCoursesNoDefault()
Testing method for getCourses without a default driver
public
testGetCoursesNoDefault() : void
Return values
void —testGetDefaultLoginDriver()
Testing method for getDefaultLoginDriver
public
testGetDefaultLoginDriver() : void
Return values
void —testGetDefaultPickUpLocation()
Testing method for getDefaultPickUpLocation
public
testGetDefaultPickUpLocation() : void
Return values
void —testGetDefaultRequestGroup()
Testing method for getDefaultRequestGroup
public
testGetDefaultRequestGroup() : void
Return values
void —testGetDepartments()
Testing method for getDepartments
public
testGetDepartments() : void
Return values
void —testGetDepartmentsNoDefault()
Testing method for getDepartments without a default driver
public
testGetDepartmentsNoDefault() : void
Return values
void —testGetDriver()
Test that MultiBackend can properly retrieve a new driver.
public
testGetDriver() : void
Return values
void —testGetDriverConfig()
Tests that getDriverConfig works correctly
public
testGetDriverConfig() : void
Return values
void —testGetHolding()
Testing method for getHolding
public
testGetHolding() : void
Return values
void —testGetHoldLink()
Testing method for getHoldLink
public
testGetHoldLink() : void
Return values
void —testGetILLPickupLibraries()
Testing method for getILLPickupLibraries
public
testGetILLPickupLibraries() : void
Return values
void —testGetILLPickupLocations()
Testing method for getILLPickupLocations
public
testGetILLPickupLocations() : void
Return values
void —testGetInstructors()
Testing method for getInstructors
public
testGetInstructors() : void
Return values
void —testGetInstructorsNoDefault()
Testing method for getInstructors without a default driver
public
testGetInstructorsNoDefault() : void
Return values
void —testGetLocalId()
This method tests getLocalId.
public
testGetLocalId() : mixed
Return values
mixed —A MultiBackend instance.
testGetLoginDrivers()
Testing method for getLoginDrivers
public
testGetLoginDrivers() : void
Return values
void —testGetMyFines()
Testing method for getMyFines
public
testGetMyFines() : void
Return values
void —testGetMyHolds()
Testing method for getMyHolds
public
testGetMyHolds() : void
Return values
void —testGetMyILLRequests()
Testing method for getMyILLRequests
public
testGetMyILLRequests() : void
Return values
void —testGetMyProfile()
Testing method for getMyProfile
public
testGetMyProfile() : void
Return values
void —testGetMyStorageRetrievalRequests()
Testing method for getMyStorageRetrievalRequests
public
testGetMyStorageRetrievalRequests() : void
Return values
void —testGetMyTransactions()
Testing method for getMyTransactions
public
testGetMyTransactions() : void
Return values
void —testGetNewItems()
Testing method for getNewItems with a default driver
public
testGetNewItems() : void
Return values
void —testGetNewItemsNoDefault()
Testing method for getNewItems without a default driver
public
testGetNewItemsNoDefault() : void
Return values
void —testGetPickUpLocations()
Testing method for getPickUpLocations
public
testGetPickUpLocations() : void
Return values
void —testGetPurchaseHistory()
Testing method for getPurchaseHistory
public
testGetPurchaseHistory() : void
Return values
void —testGetRenewDetails()
Testing method for getRenewDetails
public
testGetRenewDetails() : void
Return values
void —testGetRequestBlocks()
Testing method for getRequestBlocks
public
testGetRequestBlocks() : void
Return values
void —testGetRequestGroups()
Testing method for getRequestGroups
public
testGetRequestGroups() : void
Return values
void —testGetSourceFromParams()
Testing method for getSourceFromParams
public
testGetSourceFromParams() : void
Return values
void —testGetStatus()
Testing method for getStatus
public
testGetStatus() : void
Return values
void —testGetStatuses()
Testing method for getStatuses
public
testGetStatuses() : void
Return values
void —testILSConfigurationPathWithDriverConfigPath()
Test that driver handles ILS driver configuration loading properly when drivers_config_path is defined.
public
testILSConfigurationPathWithDriverConfigPath() : void
Return values
void —testILSConfigurationPathWithoutDriverConfigPath()
Test that driver handles ILS driver configuration loading properly when drivers_config_path is not defined.
public
testILSConfigurationPathWithoutDriverConfigPath() : void
Return values
void —testInitialization()
Test that the driver can be properly initialized.
public
testInitialization() : void
Return values
void —testLogging()
Tests that logging works correctly
public
testLogging() : void
Return values
void —testMissingConfiguration()
Test that driver complains about missing configuration.
public
testMissingConfiguration() : void
Return values
void —testMissingILSConfiguration()
Test that driver handles missing ILS driver configuration properly.
public
testMissingILSConfiguration() : void
Return values
void —testPatronLogin()
Test that MultiBackend can properly find a driver and pass log in credentials to it
public
testPatronLogin() : void
Return values
void —testPlaceHold()
Testing method for placeHold
public
testPlaceHold() : void
Return values
void —testPlaceILLRequest()
Testing method for placeILLRequest
public
testPlaceILLRequest() : void
Return values
void —testPlaceStorageRetrievalRequest()
Testing method for placeStorageRetrievalRequest
public
testPlaceStorageRetrievalRequest() : void
Return values
void —testRenewMyItems()
Testing method for renewMyItems
public
testRenewMyItems() : void
Return values
void —testStripIdPrefixes()
Testing method for stripIdPrefixes
public
testStripIdPrefixes() : void
Return values
void —testSupportsMethod()
Test that MultiBackend can properly tell whether or not a driver is has contains a specified method.
public
testSupportsMethod() : void
Return values
void —callMethod()
Call protected or private method for side-effect and result.
protected
callMethod(object|string $object, string $method[, array<string|int, mixed> $arguments = [] ]) : mixed
Uses PHP's reflection API in order to modify method accessibility.
Parameters
- $object : object|string
-
Object or class name
- $method : string
-
Method name
- $arguments : array<string|int, mixed> = []
-
Method arguments
Tags
Return values
mixed —getDriver()
Method to get a raw MultiBackend Driver instance.
protected
getDriver([array<string|int, mixed> $constructorArgs = [] ]) : mixed
Parameters
- $constructorArgs : array<string|int, mixed> = []
-
Optional constructor arguments
Return values
mixed —A MultiBackend instance.
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 —getMockDemoDriver()
Get a mock Demo driver
protected
getMockDemoDriver() : Demo
Return values
Demo —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 —getMockILS()
Get a mock driver
protected
getMockILS(string $type[, array<string|int, mixed> $methods = null ]) : AbstractBase
Parameters
- $type : string
-
Type of driver to make
- $methods : array<string|int, mixed> = null
-
Array of methods to stub
Return values
AbstractBase —getMockILSAuthenticator()
Get a mock ILS authenticator
protected
getMockILSAuthenticator([string $userSource = '' ]) : ILSAuthenticator
Parameters
- $userSource : string = ''
-
Source id, if the authenticator should emulate a situation where a user has logged in. Set to null for the attempt to cause an exception.
Return values
ILSAuthenticator —getMockSM()
This function returns a mock service manager with the given parameters For examples of what is to be passed, see: http://www.phpunit.de/manual/3.0/en/mock-objects.html
protected
getMockSM([object $times = null ][, object $driver = 'Voyager' ][, mixed $return = null ]) : object
Parameters
- $times : object = null
-
The number of times it is expected to be called.
- $driver : object = 'Voyager'
-
The driver type this SM will expect to be called with.
- $return : mixed = null
-
What that get function should return.
Return values
object —The Mock Service Manager created.
getMultiDriverForDrivers()
Create a Multi Driver for the given ILS drivers
protected
getMultiDriverForDrivers(array<string|int, mixed> $drivers[, mixed $count = null ]) : AbstractMultiDriver
Parameters
- $drivers : array<string|int, mixed>
-
Array of drivers with prefix as key and driver instance as value
- $count : mixed = null
-
How many drivers are expected to be used. Default is that all defined drivers are to be used.
Return values
AbstractMultiDriver —getPatron()
Method to get a patron with the given username
protected
getPatron(string $username[, string $instance = null ]) : array<string|int, mixed>
Parameters
- $username : string
-
The username to use
- $instance : string = null
-
The instance to append before the username
Return values
array<string|int, mixed> —A patron array.
getProperty()
Return protected or private property.
protected
getProperty(object|string $object, string $property) : mixed
Uses PHP's reflection API in order to modify property accessibility.
Parameters
- $object : object|string
-
Object or class name
- $property : string
-
Property name
Tags
Return values
mixed —initDriver()
Method to get an initialized MultiBackend Driver.
protected
initDriver([array<string|int, mixed> $constructorArgs = [] ][, array<string|int, mixed> $drivers = [] ][, string|null $driversConfigPath = null ]) : mixed
Parameters
- $constructorArgs : array<string|int, mixed> = []
-
Optional constructor arguments
- $drivers : array<string|int, mixed> = []
-
List of used drivers
- $driversConfigPath : string|null = null
-
Optional driver config path
Return values
mixed —A MultiBackend instance.
initSimpleMethodTest()
Initialize a MultiBackend driver for a simple method test with three drivers: Voyager, Demo and Dummy that doesn't handle anything
protected
initSimpleMethodTest(object $times1, object $times2, string $function, array<string|int, mixed> $params, mixed $return1, mixed $return2) : object
Parameters
- $times1 : object
-
The number of times first driver is expected to be called
- $times2 : object
-
The number of times second driver is expected to be called
- $function : string
-
Function name
- $params : array<string|int, mixed>
-
Function parameters
- $return1 : mixed
-
What the function should return with first driver
- $return2 : mixed
-
What the function should return with second driver
Return values
object —MultiBackend driver
setProperty()
Set protected or private property.
protected
setProperty(object|string $object, string $property, mixed $value) : void
Uses PHP's reflection API in order to modify property accessibility.
Parameters
- $object : object|string
-
Object or class name
- $property : string
-
Property name
- $value : mixed
-
Property value