AbstractMultiDriverTestCase
extends TestCase
in package
Uses
ConfigPluginManagerTrait, ReflectionTrait
Abstract multi driver test
Tags
Table of Contents
- testGetDriver() : void
- Test that MultiBackend can properly retrieve a new driver.
- testGetDriverConfig() : void
- Tests that getDriverConfig works correctly
- 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() : array<string|int, mixed>
- Tests that logging works correctly
- testMissingConfiguration() : void
- Test that driver complains about missing configuration.
- callMethod() : mixed
- Call protected or private method for side-effect and result.
- getDriver() : mixed
- Method to get a raw Multi 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
- 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 Multi Driver.
- setProperty() : void
- Set protected or private property.
Methods
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 —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() : array<string|int, mixed>
Return values
array<string|int, mixed> —testMissingConfiguration()
Test that driver complains about missing configuration.
public
testMissingConfiguration() : 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 Multi Driver instance.
protected
abstract getDriver([array<string|int, mixed> $constructorArgs = [] ]) : mixed
Parameters
- $constructorArgs : array<string|int, mixed> = []
-
Optional constructor arguments
Return values
mixed —A Multi Driver 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 —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 Multi Driver.
protected
abstract 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.
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