VuFind API Documentation

BokinfoTest extends TestCase
in package
Uses FixtureTrait, WithConsecutiveTrait

Unit tests for Bokinfo cover loader.

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

testMissingIsbn()  : void
Test missing ISBN
testMissingKey()  : void
Test missing API key
testValidCoverLoading()  : void
Test cover loading
expectConsecutiveCalls()  : InvocationStubber
Expect consecutive calls to a 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).
getMockClient()  : Client
Get a mock HTTP client.
getMockRequest()  : Request
Get mock request/headers to expect key setting.
getMockResponse()  : Response
Get mock response object
getMockService()  : HttpService
Get a mock HTTP service to support testValidCoverLoading().

Methods

testMissingIsbn()

Test missing ISBN

public testMissingIsbn() : void
Return values
void

testMissingKey()

Test missing API key

public testMissingKey() : void
Return values
void

testValidCoverLoading()

Test cover loading

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

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>

getMockClient()

Get a mock HTTP client.

protected getMockClient() : Client
Return values
Client

getMockRequest()

Get mock request/headers to expect key setting.

protected getMockRequest() : Request
Return values
Request

getMockResponse()

Get mock response object

protected getMockResponse() : Response
Return values
Response

getMockService()

Get a mock HTTP service to support testValidCoverLoading().

protected getMockService() : HttpService
Return values
HttpService

Search results