BrowZineTest
extends TestCase
in package
Uses
FixtureTrait, SearchServiceTrait
BrowZine Test Class
Tags
Table of Contents
- testApiSuccess() : void
- Test an API response.
- getBackendManager() : BackendManager
- Given a connector, wrap it up in a backend and backend manager
- 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).
- getMockConnector() : Connector
- Get a mock connector
- getSearchService() : Service
- Create a search service to wrap the provided BackendManager instance
Methods
testApiSuccess()
Test an API response.
public
testApiSuccess() : void
Return values
void —getBackendManager()
Given a connector, wrap it up in a backend and backend manager
protected
getBackendManager(Connector $connector) : BackendManager
Parameters
- $connector : Connector
-
Connector
Return values
BackendManager —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> —getMockConnector()
Get a mock connector
protected
getMockConnector(string $doi, array<string|int, mixed> $response) : Connector
Parameters
- $doi : string
-
DOI expected by connector
- $response : array<string|int, mixed>
-
Response for connector to return
Return values
Connector —getSearchService()
Create a search service to wrap the provided BackendManager instance
protected
getSearchService(BackendManager $bm) : Service
Parameters
- $bm : BackendManager
-
BackendManager to wrap in service