GoogleTest
extends TestCase
in package
Uses
ConfigPluginManagerTrait, FixtureTrait
Unit tests for Google cover loader.
Tags
Table of Contents
- testEmptyResponse() : void
- Test invalid (empty) response
- testInvalidNonEmptyResponse() : void
- Test invalid (non-empty, non-parseable) response
- testMissingDownloader() : void
- Test missing downloader
- testMissingIsbn() : void
- Test missing ISBN
- testNoAvailableThumbnailLoading() : void
- Test successful transaction containing no thumbnails.
- testOCLCLoading() : void
- Test successful transaction using OCLC number.
- testValidCoverLoading() : void
- Test cover loading with a single ISBN
- testValidCoverLoadingWithMultipleIds() : void
- Test cover loading with multiple IDs
- testValidLargeCoverLoading() : void
- Test cover loading at a larger size
- getDownloadCallback() : callable
- Get a callback to check the download function call.
- 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).
- getMockConfigPluginManager() : MockObject|PluginManager
- Get a mock configuration plugin manager with the given configuration "files" available.
- getMockFailingConfigPluginManager() : MockObject|PluginManager
- Get a mock configuration plugin manager that will throw an exception.
Methods
testEmptyResponse()
Test invalid (empty) response
public
testEmptyResponse() : void
Return values
void —testInvalidNonEmptyResponse()
Test invalid (non-empty, non-parseable) response
public
testInvalidNonEmptyResponse() : void
Return values
void —testMissingDownloader()
Test missing downloader
public
testMissingDownloader() : void
Return values
void —testMissingIsbn()
Test missing ISBN
public
testMissingIsbn() : void
Return values
void —testNoAvailableThumbnailLoading()
Test successful transaction containing no thumbnails.
public
testNoAvailableThumbnailLoading() : void
Return values
void —testOCLCLoading()
Test successful transaction using OCLC number.
public
testOCLCLoading() : void
Return values
void —testValidCoverLoading()
Test cover loading with a single ISBN
public
testValidCoverLoading() : void
Return values
void —testValidCoverLoadingWithMultipleIds()
Test cover loading with multiple IDs
public
testValidCoverLoadingWithMultipleIds() : void
Return values
void —testValidLargeCoverLoading()
Test cover loading at a larger size
public
testValidLargeCoverLoading() : void
Return values
void —getDownloadCallback()
Get a callback to check the download function call.
protected
getDownloadCallback(string $body, string|array<string|int, string> $expectedIds) : callable
Parameters
- $body : string
-
Body for mock to return
- $expectedIds : string|array<string|int, string>
-
Identifier(s) expected in request URL
Return values
callable —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> —getMockConfigPluginManager()
Get a mock configuration plugin manager with the given configuration "files" available.
protected
getMockConfigPluginManager(array<string|int, mixed> $configs[, array<string|int, mixed> $default = [] ][, InvocationOrder|null $getExpect = null ][, InvocationOrder|null $hasExpect = null ]) : MockObject|PluginManager
Parameters
- $configs : array<string|int, mixed>
-
An associative array of configurations where key is the file (e.g. 'config') and value an array of configuration sections and directives
- $default : array<string|int, mixed> = []
-
Default configuration to return when no entry is found in $configs
- $getExpect : InvocationOrder|null = null
-
The expected invocation order for the get() method (null for any)
- $hasExpect : InvocationOrder|null = null
-
The expected invocation order for the has() method (null for any)
Return values
MockObject|PluginManager —getMockFailingConfigPluginManager()
Get a mock configuration plugin manager that will throw an exception.
protected
getMockFailingConfigPluginManager(Throwable $exception) : MockObject|PluginManager
Parameters
- $exception : Throwable
-
Exception to throw