RandomRecommendTest
extends TestCase
in package
Uses
FixtureTrait, ReflectionTrait, SolrSearchObjectTrait
Random Recommend tests.
Tags
Table of Contents
- $recommend : RandomRecommend
- Random recommendation module class
- getMockConfigManager() : PluginManager
- Get mock config manager.
- getSolrOptions() : Options
- Get Solr options.
- getSolrParams() : Params
- Get Solr params.
- getSolrResults() : Results
- Get Solr results.
- setUp() : void
- Standard setup method.
- testCanInitialise() : void
- Test initialisation
- testCanInitialiseInDisregardMode() : void
- Test initialisation
- testCanSetDisplayMode() : void
- Test displaymode
- testCanSetSettings() : void
- Test settings
- testDefaultSettings() : void
- Test default settings
- testWillReturnEmptyForMinimumResultLimit() : void
- Test minimum result limit feature
- testWillReturnResults() : void
- Test results coming back
- callMethod() : mixed
- Call protected or private method for side-effect and result.
- getConfiguredModule() : RandomRecommend
- Get a module configured to return results.
- 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.
- setProperty() : void
- Set protected or private property.
- unserializeFixture() : mixed
- Get a fixture object
Properties
$recommend
Random recommendation module class
protected
RandomRecommend
$recommend
Methods
getMockConfigManager()
Get mock config manager.
public
getMockConfigManager() : PluginManager
Return values
PluginManager —getSolrOptions()
Get Solr options.
public
getSolrOptions() : Options
Return values
Options —getSolrParams()
Get Solr params.
public
getSolrParams([Options $options = null ]) : Params
Parameters
- $options : Options = null
-
Solr options to inject (null for default)
Return values
Params —getSolrResults()
Get Solr results.
public
getSolrResults([Params $params = null ]) : Results
Parameters
- $params : Params = null
-
Solr parameters to inject (null for default)
Return values
Results —setUp()
Standard setup method.
public
setUp() : void
Return values
void —testCanInitialise()
Test initialisation
public
testCanInitialise() : void
Return values
void —testCanInitialiseInDisregardMode()
Test initialisation
public
testCanInitialiseInDisregardMode() : void
Return values
void —testCanSetDisplayMode()
Test displaymode
public
testCanSetDisplayMode() : void
Return values
void —testCanSetSettings()
Test settings
public
testCanSetSettings() : void
Return values
void —testDefaultSettings()
Test default settings
public
testDefaultSettings() : void
Return values
void —testWillReturnEmptyForMinimumResultLimit()
Test minimum result limit feature
public
testWillReturnEmptyForMinimumResultLimit() : void
Return values
void —testWillReturnResults()
Test results coming back
public
testWillReturnResults() : 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 —getConfiguredModule()
Get a module configured to return results.
protected
getConfiguredModule(string $recConfig) : RandomRecommend
Parameters
- $recConfig : string
-
Recommendation module configuration
Return values
RandomRecommend —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 —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
Tags
Return values
void —unserializeFixture()
Get a fixture object
protected
unserializeFixture(string $file) : mixed
Parameters
- $file : string
-
Fixture name