PluginFactoryTest
extends TestCase
in package
Uses
FixtureTrait, PathResolverTrait
Config Factory Test Class
Tags
Table of Contents
- $factory : PluginFactory
- Plugin factory instance.
- setUp() : void
- Standard setup method.
- testBasicRead() : void
- Test basic config.ini loading.
- testCustomRead() : void
- Test loading of a custom .ini file.
- testInheritance() : void
- Test inheritance features.
- testInheritanceWithArrayMerging() : void
- Test inheritance features with array merging turned on.
- testParentConfigOmission() : void
- Test that the plugin factory omits the Parent_Config section from the merged configuration.
- testReadOnlyConfig() : void
- Test configuration is read-only.
- addPathResolverToContainer() : void
- Add PathResolverFactory to a mock container
- getConfig() : Config
- Wrapper around factory
- 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).
- getPathResolver() : PathResolver
- Get a config file path resolver
Properties
$factory
Plugin factory instance.
protected
PluginFactory
$factory
Methods
setUp()
Standard setup method.
public
setUp() : void
Return values
void —testBasicRead()
Test basic config.ini loading.
public
testBasicRead() : void
Return values
void —testCustomRead()
Test loading of a custom .ini file.
public
testCustomRead() : void
Return values
void —testInheritance()
Test inheritance features.
public
testInheritance() : void
Return values
void —testInheritanceWithArrayMerging()
Test inheritance features with array merging turned on.
public
testInheritanceWithArrayMerging() : void
Return values
void —testParentConfigOmission()
Test that the plugin factory omits the Parent_Config section from the merged configuration.
public
testParentConfigOmission() : void
Return values
void —testReadOnlyConfig()
Test configuration is read-only.
public
testReadOnlyConfig() : void
Return values
void —addPathResolverToContainer()
Add PathResolverFactory to a mock container
protected
addPathResolverToContainer(MockContainer $container) : void
Parameters
- $container : MockContainer
-
Mock Container
Return values
void —getConfig()
Wrapper around factory
protected
getConfig(string $name) : Config
Parameters
- $name : string
-
Configuration to load
Return values
Config —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> —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