VuFind API Documentation

LocalFileTest extends TestCase
in package
Uses FixtureTrait

Unit tests for LocalFile 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

$fixtureBase  : string
Base path to image fixtures.
invalidCoverProvider()  : array<string|int, mixed>
Data provider for testInvalidCover()
testInvalidCover()  : void
Test bad parameter/key combinations.
testValidCoverLoading()  : void
Test cover loading
validCoverProvider()  : array<string|int, mixed>
Data provider for testValidCoverLoading().
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).
runSingleLoaderTest()  : string|false
Run a single test.
setUp()  : void
Standard setup method.

Properties

$fixtureBase

Base path to image fixtures.

protected string $fixtureBase

Methods

invalidCoverProvider()

Data provider for testInvalidCover()

public static invalidCoverProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>

testInvalidCover()

Test bad parameter/key combinations.

public testInvalidCover(string $keyPattern[, array<string|int, mixed> $imageParams = [] ][, string $size = 'small' ][, bool $includeFixturePath = true ]) : void
Parameters
$keyPattern : string

Match pattern to use in key

$imageParams : array<string|int, mixed> = []

Image parameters

$size : string = 'small'

Size value to use

$includeFixturePath : bool = true

Include fixture path in key pattern?

Tags
dataProvider

invalidCoverProvider

Return values
void

testValidCoverLoading()

Test cover loading

public testValidCoverLoading(string $expectedFilename, string $keyPattern, array<string|int, mixed> $imageParams[, string $size = 'small' ][, bool $includeFixturePath = true ]) : void
Parameters
$expectedFilename : string

Fixture file matching key

$keyPattern : string

Match pattern to use in key

$imageParams : array<string|int, mixed>

Image parameters

$size : string = 'small'

Size value to use

$includeFixturePath : bool = true

Include fixture path in key pattern?

Tags
dataProvider

validCoverProvider

Return values
void

validCoverProvider()

Data provider for testValidCoverLoading().

public static validCoverProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>

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>

runSingleLoaderTest()

Run a single test.

protected runSingleLoaderTest(string $keyPattern, array<string|int, mixed> $imageParams[, string $size = 'small' ][, bool $includeFixturePath = true ]) : string|false
Parameters
$keyPattern : string

Match pattern to use in key

$imageParams : array<string|int, mixed>

Image parameters

$size : string = 'small'

Size value to use

$includeFixturePath : bool = true

Include fixture path in key pattern?

Return values
string|false

setUp()

Standard setup method.

protected setUp() : void
Return values
void

Search results