VuFind API Documentation

WebCrawlCommandTest extends TestCase
in package
Uses FixtureTrait, WithConsecutiveTrait

Import/WebCrawl command 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

successWithMinimalParametersProvider()  : array<string|int, array<string|int, mixed>>
Data provider for testSuccessWithMinimalParameters()
testForcedReadFromCache()  : void
Test re-indexing from a cached result.
testSuccessWithMinimalParameters()  : void
Test the simplest possible success case.
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()  : MockObject|WebCrawlCommand
Get a mock command object
getMockImporter()  : MockObject|Importer
Get a mock importer object
getMockSolrWriter()  : MockObject|Writer
Get a mock solr writer object
normalizeOutput()  : string
Normalize output for easier assertion-making.

Methods

successWithMinimalParametersProvider()

Data provider for testSuccessWithMinimalParameters()

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

testForcedReadFromCache()

Test re-indexing from a cached result.

public testForcedReadFromCache() : void
Return values
void

testSuccessWithMinimalParameters()

Test the simplest possible success case.

public testSuccessWithMinimalParameters(bool $verbose, bool $cache, string $expectedOutput) : void
Parameters
$verbose : bool

Run in verbose mode?

$cache : bool

Enable cache?

$expectedOutput : string

Expected normalized output string

Tags
dataProvider

successWithMinimalParametersProvider

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>

getMockCommand()

Get a mock command object

protected getMockCommand([Importer $importer = null ][, Writer $solr = null ][, Config $config = null ][, array<string|int, mixed> $methods = ['downloadFile', 'removeTempFile', 'updateTransformCache'] ]) : MockObject|WebCrawlCommand
Parameters
$importer : Importer = null

Importer object

$solr : Writer = null

Solr writer object

$config : Config = null

Configuration

$methods : array<string|int, mixed> = ['downloadFile', 'removeTempFile', 'updateTransformCache']

Methods to mock

Return values
MockObject|WebCrawlCommand

getMockImporter()

Get a mock importer object

protected getMockImporter([array<string|int, mixed> $methods = [] ]) : MockObject|Importer
Parameters
$methods : array<string|int, mixed> = []

Methods to mock

Return values
MockObject|Importer

getMockSolrWriter()

Get a mock solr writer object

protected getMockSolrWriter([array<string|int, mixed> $methods = [] ]) : MockObject|Writer
Parameters
$methods : array<string|int, mixed> = []

Methods to mock

Return values
MockObject|Writer

normalizeOutput()

Normalize output for easier assertion-making.

protected normalizeOutput(string $output) : string
Parameters
$output : string

Raw output

Return values
string

Search results