VuFind API Documentation

ImporterTest extends TestCase
in package
Uses FixtureTrait, PathResolverTrait

CSV Importer Test Class

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

$container  : MockContainer
Mock container for use by tests.
$csvFixtureDir  : string
Location of fixture files.
setUp()  : void
Setup method.
testAdvancedCallbacks()  : void
Test importing a CSV with extra callbacks using advanced features
testCallbackDependencyInjection()  : void
Test that importer injects dependencies into static callback classes when appropriate.
testEncodingMismatch()  : void
Test behavior when the actual encoding and configured encoding are mismatched.
testImportInLiveMode()  : void
Test importer functionality (in non-test mode).
testImportInSmallBatches()  : void
Test importer functionality (with small batch size set).
testImportInTestMode()  : void
Test importer functionality (in test mode).
testImportIsoEncoding()  : void
Test importer functionality with non-default ISO-8859-1 encoding (in test mode).
testMultilineValues()  : void
Test importer functionality with multiline CSV values (in test mode).
testNoHeader()  : void
Test importing a CSV with no header row.
testSkipHeader()  : void
Test skipping the header row in the CSV
addPathResolverToContainer()  : void
Add PathResolverFactory to a mock container
getFixture()  : string
Load a fixture file.
getFixtureDir()  : string
Get the base directory containing fixtures.
getFixturePath()  : string
Resolve fixture path.
getImporter()  : Importer
Get an Importer configured for testing.
getJsonFixture()  : array<string|int, mixed>
Load a JSON fixture from file (using associative array return type).
getPathResolver()  : PathResolver
Get a config file path resolver
runTestModeTest()  : void
Run a test in test mode.

Properties

$csvFixtureDir

Location of fixture files.

protected string $csvFixtureDir

Methods

setUp()

Setup method.

public setUp() : void
Return values
void

testAdvancedCallbacks()

Test importing a CSV with extra callbacks using advanced features

public testAdvancedCallbacks() : void
Return values
void

testCallbackDependencyInjection()

Test that importer injects dependencies into static callback classes when appropriate.

public testCallbackDependencyInjection() : void
Return values
void

testEncodingMismatch()

Test behavior when the actual encoding and configured encoding are mismatched.

public testEncodingMismatch() : void
Return values
void

testImportInLiveMode()

Test importer functionality (in non-test mode).

public testImportInLiveMode() : void
Return values
void

testImportInSmallBatches()

Test importer functionality (with small batch size set).

public testImportInSmallBatches() : void
Return values
void

testImportInTestMode()

Test importer functionality (in test mode).

public testImportInTestMode() : void
Return values
void

testImportIsoEncoding()

Test importer functionality with non-default ISO-8859-1 encoding (in test mode).

public testImportIsoEncoding() : void
Return values
void

testMultilineValues()

Test importer functionality with multiline CSV values (in test mode).

public testMultilineValues() : void
Return values
void

testNoHeader()

Test importing a CSV with no header row.

public testNoHeader() : void
Return values
void

testSkipHeader()

Test skipping the header row in the CSV

public testSkipHeader() : void
Return values
void

addPathResolverToContainer()

Add PathResolverFactory to a mock container

protected addPathResolverToContainer(MockContainer $container) : void
Parameters
$container : MockContainer

Mock Container

Return values
void

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>

getPathResolver()

Get a config file path resolver

protected getPathResolver([string|null $baseDirectory = null ]) : PathResolver
Parameters
$baseDirectory : string|null = null

Optional directory to override APPLICATION_PATH

Return values
PathResolver

runTestModeTest()

Run a test in test mode.

protected runTestModeTest([array<string|int, mixed> $options = [] ]) : void
Parameters
$options : array<string|int, mixed> = []

Options to override.

Return values
void

Search results