ThemeInfoTest
extends TestCase
in package
Uses
FixtureTrait, ReflectionTrait
ThemeInfo Test Class
Tags
Table of Contents
- $fixturePath : string
- Path to theme fixtures
- mergeEdgeCasesProvider() : array<string|int, mixed>
- Test cases for mergeWithoutOverride
- setUp() : void
- Generic setup function
- testCaching() : void
- Test that caching works correctly.
- testFindContainingTheme() : void
- Test findContainingTheme()
- testFindContainingThemeWithMixin() : void
- Test findContainingTheme() with a mixin
- testFindInThemes() : void
- Test findInThemes()
- testGetBaseDir() : void
- Test getBaseDir
- testGetMergedConfigChild() : void
- Test getMergedConfig() using a child theme
- testGetMergedConfigMixin() : void
- Test getMergedConfig() using a mixin
- testGetMergedConfigNoKey() : void
- Test getMergedConfig() with no key (return all)
- testGetMergedConfigParentOnly() : void
- Test getMergedConfig() with a basic theme
- testGetMergedConfigReturnString() : void
- Test getMergedConfig() on string value in config
- testGetThemeInfo() : void
- Test theme info
- testGetThemeInfoWithMixin() : void
- Test theme info with a mixin
- testInvalidTheme() : void
- Test setting invalid theme
- testMergeWithoutOverrideEdgeCases() : void
- Stress-test our merging algorithm
- testThemeSetting() : void
- Test get/setTheme
- testUnfindableItem() : void
- Test unfindable item.
- callMethod() : mixed
- Call protected or private method for side-effect and result.
- 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).
- getProperty() : mixed
- Return protected or private property.
- getThemeInfo() : ThemeInfo
- Get a test object
- setProperty() : void
- Set protected or private property.
Properties
$fixturePath
Path to theme fixtures
protected
string
$fixturePath
Methods
mergeEdgeCasesProvider()
Test cases for mergeWithoutOverride
public
static mergeEdgeCasesProvider() : array<string|int, mixed>
Return values
array<string|int, mixed> —setUp()
Generic setup function
public
setUp() : void
Return values
void —testCaching()
Test that caching works correctly.
public
testCaching() : void
Return values
void —testFindContainingTheme()
Test findContainingTheme()
public
testFindContainingTheme() : void
Return values
void —testFindContainingThemeWithMixin()
Test findContainingTheme() with a mixin
public
testFindContainingThemeWithMixin() : void
Return values
void —testFindInThemes()
Test findInThemes()
public
testFindInThemes() : void
Return values
void —testGetBaseDir()
Test getBaseDir
public
testGetBaseDir() : void
Return values
void —testGetMergedConfigChild()
Test getMergedConfig() using a child theme
public
testGetMergedConfigChild() : void
Return values
void —testGetMergedConfigMixin()
Test getMergedConfig() using a mixin
public
testGetMergedConfigMixin() : void
Return values
void —testGetMergedConfigNoKey()
Test getMergedConfig() with no key (return all)
public
testGetMergedConfigNoKey() : void
Return values
void —testGetMergedConfigParentOnly()
Test getMergedConfig() with a basic theme
public
testGetMergedConfigParentOnly() : void
Return values
void —testGetMergedConfigReturnString()
Test getMergedConfig() on string value in config
public
testGetMergedConfigReturnString() : void
Return values
void —testGetThemeInfo()
Test theme info
public
testGetThemeInfo() : void
Return values
void —testGetThemeInfoWithMixin()
Test theme info with a mixin
public
testGetThemeInfoWithMixin() : void
Return values
void —testInvalidTheme()
Test setting invalid theme
public
testInvalidTheme() : void
Return values
void —testMergeWithoutOverrideEdgeCases()
Stress-test our merging algorithm
public
testMergeWithoutOverrideEdgeCases(array<string|int, mixed> $test, array<string|int, mixed> $expected) : void
Parameters
- $test : array<string|int, mixed>
-
Test data
- $expected : array<string|int, mixed>
-
Expected response
Tags
Return values
void —testThemeSetting()
Test get/setTheme
public
testThemeSetting() : void
Return values
void —testUnfindableItem()
Test unfindable item.
public
testUnfindableItem() : void
Return values
void —callMethod()
Call protected or private method for side-effect and result.
protected
callMethod(object|string $object, string $method[, array<string|int, mixed> $arguments = [] ]) : mixed
Uses PHP's reflection API in order to modify method accessibility.
Parameters
- $object : object|string
-
Object or class name
- $method : string
-
Method name
- $arguments : array<string|int, mixed> = []
-
Method arguments
Tags
Return values
mixed —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> —getProperty()
Return protected or private property.
protected
getProperty(object|string $object, string $property) : mixed
Uses PHP's reflection API in order to modify property accessibility.
Parameters
- $object : object|string
-
Object or class name
- $property : string
-
Property name
Tags
Return values
mixed —getThemeInfo()
Get a test object
protected
getThemeInfo() : ThemeInfo
Return values
ThemeInfo —setProperty()
Set protected or private property.
protected
setProperty(object|string $object, string $property, mixed $value) : void
Uses PHP's reflection API in order to modify property accessibility.
Parameters
- $object : object|string
-
Object or class name
- $property : string
-
Property name
- $value : mixed
-
Property value