ConsortialVuFindTest
extends TestCase
in package
Uses
FixtureTrait
ConsortialVuFind recommendation module Test Class
Tags
Table of Contents
- $connector : ExternalVuFind
- ExternalVuFind connection object
- $consortialVuFind : ConsortialVuFind
- ConsortialVuFind object
- setUp() : void
- Set up mocks for tests.
- testGetMoreResultsUrl() : void
- Test the getMoreResultsUrl function
- testGetResults() : void
- Test the getResults function
- buildConfig() : ConsortialVuFind
- Build an object representing an ExternalVuFind.ini configuration file
- buildConsortialVuFind() : ConsortialVuFind
- Build and pre-process a ConsortialVuFind object
- buildQueryResults() : Results
- Build a partially mocked Results object for a given query string
- 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).
Properties
$connector
ExternalVuFind connection object
protected
ExternalVuFind
$connector
$consortialVuFind
ConsortialVuFind object
protected
ConsortialVuFind
$consortialVuFind
Methods
setUp()
Set up mocks for tests.
public
setUp() : void
Return values
void —testGetMoreResultsUrl()
Test the getMoreResultsUrl function
public
testGetMoreResultsUrl() : void
Return values
void —testGetResults()
Test the getResults function
public
testGetResults() : void
Return values
void —buildConfig()
Build an object representing an ExternalVuFind.ini configuration file
protected
buildConfig() : ConsortialVuFind
Return values
ConsortialVuFind —buildConsortialVuFind()
Build and pre-process a ConsortialVuFind object
protected
buildConsortialVuFind(Config $config) : ConsortialVuFind
Parameters
- $config : Config
-
The config object
Return values
ConsortialVuFind —buildQueryResults()
Build a partially mocked Results object for a given query string
protected
buildQueryResults(string $queryString[, array<string|int, mixed> $facets = [] ]) : Results
Parameters
- $queryString : string
-
The query string
- $facets : array<string|int, mixed> = []
-
The result facets
Return values
Results —The Results object
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.