VuFind API Documentation

DedupeCommandTest extends TestCase
in package
Uses FixtureTrait, WithConsecutiveTrait

DedupeCommand 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

Wiki

Table of Contents

testSuccessWithArguments()  : void
Test success with command line arguments.
testSuccessWithoutArguments()  : void
Test success with interactive input.
testWithMissingFile()  : void
Test that missing file yields an error message.
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).
getMockCommand()  : DedupeCommand
Get a mocked-out command object.
setSuccessfulExpectations()  : void
Set up basic expectations on a command.

Methods

testSuccessWithArguments()

Test success with command line arguments.

public testSuccessWithArguments() : void
Return values
void

testSuccessWithoutArguments()

Test success with interactive input.

public testSuccessWithoutArguments() : void
Return values
void

testWithMissingFile()

Test that missing file yields an error message.

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

setSuccessfulExpectations()

Set up basic expectations on a command.

protected setSuccessfulExpectations(DedupeCommand $command, string $output) : void
Parameters
$command : DedupeCommand

Mock command

$output : string

Output filename

Return values
void

Search results