VuFind API Documentation

KohaRestTest extends ILSDriverTestCase
in package
Uses FixtureTrait

KohaRest ILS driver test

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

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

link

Main Page

Table of Contents

$currentFixture  : string
Current fixture name
$currentFixtureStep  : int
Current fixture step
$defaultDriverConfig  : array<string|int, mixed>
Default test configuration
$driver  : AbstractBase
ILS driver
$fixtureSteps  : array<string|int, mixed>
Test data for simulated HTTP responses (reset by each test)
mockMakeRequest()  : array<string|int, mixed>
Replace makeRequest to inject test returns
setUp()  : void
Standard setup method.
testGetUrlsForRecord()  : void
Test getUrlsForRecord.
testMissingConfiguration()  : void
Test that driver complains about missing configuration.
testPurgeTransactionHistoryAll()  : void
Test purging of transaction history
testPurgeTransactionHistorySelected()  : void
Test that selective deletion of entries from transaction history throws an exception
createConnector()  : void
Generate a new KohaRest driver to return responses set in a json fixture
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

$currentFixture

Current fixture name

protected string $currentFixture = 'none'

$currentFixtureStep

Current fixture step

protected int $currentFixtureStep = 0

$defaultDriverConfig

Default test configuration

protected array<string|int, mixed> $defaultDriverConfig = ['Catalog' => ['host' => 'http://localhost', 'clientId' => 'config_id', 'clientSecret' => 'config_secret']]

$fixtureSteps

Test data for simulated HTTP responses (reset by each test)

protected array<string|int, mixed> $fixtureSteps = []

Methods

mockMakeRequest()

Replace makeRequest to inject test returns

public mockMakeRequest(array<string|int, mixed> $request) : array<string|int, mixed>
Parameters
$request : array<string|int, mixed>

Either a path as string or non-keyed array of path elements, or a keyed array of request parameters

Return values
array<string|int, mixed>

setUp()

Standard setup method.

public setUp() : void
Return values
void

testGetUrlsForRecord()

Test getUrlsForRecord.

public testGetUrlsForRecord() : void
Return values
void

testMissingConfiguration()

Test that driver complains about missing configuration.

public testMissingConfiguration() : void
Return values
void

testPurgeTransactionHistoryAll()

Test purging of transaction history

public testPurgeTransactionHistoryAll() : void
Return values
void

testPurgeTransactionHistorySelected()

Test that selective deletion of entries from transaction history throws an exception

public testPurgeTransactionHistorySelected() : void
Return values
void

createConnector()

Generate a new KohaRest driver to return responses set in a json fixture

protected createConnector(string $test[, array<string|int, mixed> $config = null ]) : void

Overwrites $this->driver Uses session cache

Parameters
$test : string

Name of test fixture to load

$config : array<string|int, mixed> = null

Driver configuration (null to use default)

Return values
void

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