IndexReservesCommandTest
extends TestCase
in package
Uses
FixtureTrait, WithConsecutiveTrait
IndexReservesCommand test.
Tags
Table of Contents
- testBadFilename() : void
- Test missing file.
- testBadParameterCombination() : void
- Test bad parameter combination.
- testMissingData() : void
- Test unsuccessful ILS loading (missing data elements).
- testSuccessWithILS() : void
- Test successful ILS loading.
- testSuccessWithMultipleFiles() : void
- Test successful file loading.
- expectConsecutiveCalls() : InvocationStubber
- Expect consecutive calls to a mock.
- getCommand() : IndexReservesCommand
- Get command to test.
- getFixture() : string
- Load a fixture file.
- getFixtureDir() : string
- Get the base directory containing fixtures.
- getFixturePath() : string
- Resolve fixture path.
- getJsonFixture() : array<string|int, mixed>
- Load a JSON fixture from file (using associative array return type).
- getMockIlsConnection() : Connection
- Get mock ILS connection.
- getMockSolrWriter() : Writer
- Get mock Solr writer.
Methods
testBadFilename()
Test missing file.
public
testBadFilename() : void
Return values
void —testBadParameterCombination()
Test bad parameter combination.
public
testBadParameterCombination() : void
Return values
void —testMissingData()
Test unsuccessful ILS loading (missing data elements).
public
testMissingData() : void
Return values
void —testSuccessWithILS()
Test successful ILS loading.
public
testSuccessWithILS() : void
Return values
void —testSuccessWithMultipleFiles()
Test successful file loading.
public
testSuccessWithMultipleFiles() : void
Return values
void —expectConsecutiveCalls()
Expect consecutive calls to a mock.
protected
expectConsecutiveCalls(MockObject $mock, string $method, array<string|int, mixed> $expectedCalls[, mixed $returnValues = null ]) : InvocationStubber
Parameters
- $mock : MockObject
-
Mock object
- $method : string
-
Method expecting calls
- $expectedCalls : array<string|int, mixed>
-
Expected input parameters
- $returnValues : mixed = null
-
Return values to mock (either an array indexed parallel to $expectedCalls to return different values, or a single value to always return the same thing)
Return values
InvocationStubber —getCommand()
Get command to test.
protected
getCommand([Writer $solr = null ][, Connection $ils = null ]) : IndexReservesCommand
Parameters
- $solr : Writer = null
-
Solr writer
- $ils : Connection = null
-
ILS connection
Return values
IndexReservesCommand —getFixture()
Load a fixture file.
protected
getFixture(string $filename[, string $module = 'VuFind' ]) : string
Parameters
- $filename : string
-
Filename relative to fixture directory.
- $module : string = 'VuFind'
-
Module containing fixture.
Tags
Return values
string —getFixtureDir()
Get the base directory containing fixtures.
protected
getFixtureDir([string $module = 'VuFind' ]) : string
Parameters
- $module : string = 'VuFind'
-
Module containing fixture.
Return values
string —getFixturePath()
Resolve fixture path.
protected
getFixturePath(string $filename[, string $module = 'VuFind' ]) : string
Parameters
- $filename : string
-
Filename relative to fixture directory.
- $module : string = 'VuFind'
-
Module containing fixture.
Tags
Return values
string —getJsonFixture()
Load a JSON fixture from file (using associative array return type).
protected
getJsonFixture(string $filename[, string $module = 'VuFind' ]) : array<string|int, mixed>
Parameters
- $filename : string
-
Filename relative to fixture directory.
- $module : string = 'VuFind'
-
Module containing fixture.
Return values
array<string|int, mixed> —getMockIlsConnection()
Get mock ILS connection.
protected
getMockIlsConnection() : Connection
Return values
Connection —getMockSolrWriter()
Get mock Solr writer.
protected
getMockSolrWriter() : Writer