ImportLokaliseCommandTest
extends TestCase
in package
Uses
FixtureTrait, WithConsecutiveTrait
Language/Normalize command test.
Tags
Table of Contents
- $baseFixtureDir : string
- Base fixture directory
- setUp() : void
- Standard setup method.
- testBadInputParameter() : void
- Test bad input parameter.
- testBadOutputParameter() : void
- Test bad output parameter.
- testDataLoad() : void
- Test a successful load.
- testWithoutParameters() : void
- Test that missing parameters yield 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() : ImportLokaliseCommand
- Get a mock command (with file writing stubbed out).
Properties
$baseFixtureDir
Base fixture directory
protected
string
$baseFixtureDir
= null
Methods
setUp()
Standard setup method.
public
setUp() : void
Return values
void —testBadInputParameter()
Test bad input parameter.
public
testBadInputParameter() : void
Return values
void —testBadOutputParameter()
Test bad output parameter.
public
testBadOutputParameter() : void
Return values
void —testDataLoad()
Test a successful load.
public
testDataLoad() : void
Return values
void —testWithoutParameters()
Test that missing parameters yield an error message.
public
testWithoutParameters() : 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
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> —getMockCommand()
Get a mock command (with file writing stubbed out).
protected
getMockCommand() : ImportLokaliseCommand