VuFind API Documentation

BackendTest extends TestCase
in package
Uses FixtureTrait, WithConsecutiveTrait

Unit tests for LibGuides backend.

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

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

link
https://vufind.org

Table of Contents

testConstructorSetters()  : void
Test setting a custom record collection factory.
testDefaultQueryBuilder()  : void
Test generation of a default query builder.
testDefaultRecordCollectionFactory()  : void
Test construction of default record collection factory.
testMergedParamBag()  : void
Test merged param bag.
testRetrieve()  : void
Test retrieving a record (not supported).
testSearch()  : void
Test performing a search.
testSearchFallback()  : void
Test default search failover.
testSearchWrapsLibGuidesException()  : void
Test search exception handling.
testSetQueryBuilder()  : void
Test setting a query builder.
expectConsecutiveCalls()  : InvocationStubber
Expect consecutive calls to a mock.
getConnector()  : Connector
Return connector.
getConnectorMock()  : array<string|int, mixed>
Return connector mock.
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).
getRCFactory()  : RecordCollectionFactory
Build a real record collection factory

Methods

testConstructorSetters()

Test setting a custom record collection factory.

public testConstructorSetters() : void
Return values
void

testDefaultQueryBuilder()

Test generation of a default query builder.

public testDefaultQueryBuilder() : void
Return values
void

testDefaultRecordCollectionFactory()

Test construction of default record collection factory.

public testDefaultRecordCollectionFactory() : void
Return values
void

testMergedParamBag()

Test merged param bag.

public testMergedParamBag() : void
Return values
void

testRetrieve()

Test retrieving a record (not supported).

public testRetrieve() : void
Return values
void

testSearch()

Test performing a search.

public testSearch() : void
Return values
void

testSearchFallback()

Test default search failover.

public testSearchFallback() : void
Return values
void

testSearchWrapsLibGuidesException()

Test search exception handling.

public testSearchWrapsLibGuidesException() : void
Return values
void

testSetQueryBuilder()

Test setting a query builder.

public testSetQueryBuilder() : 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

getConnector()

Return connector.

protected getConnector([string $fixture = null ]) : Connector
Parameters
$fixture : string = null

HTTP response fixture to load (optional)

Return values
Connector

getConnectorMock()

Return connector mock.

protected getConnectorMock([array<string|int, mixed> $mock = [] ]) : array<string|int, mixed>
Parameters
$mock : array<string|int, mixed> = []

Functions to mock

Return values
array<string|int, mixed>

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
throws
RuntimeException
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
throws
RuntimeException
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>

Search results