LibGuidesProfileTest
extends TestCase
in package
Uses
FixtureTrait
LibGuidesProfile recommendation module Test Class
Tags
Table of Contents
- $cacheAdapter : StorageInterface
- Cache adapter object
- $connector : LibGuides
- LibGuides connection object
- $libGuidesProfile : LibGuidesProfile
- LibGuidesProfile object
- setUp() : void
- Set up mocks for tests.
- testCallNumberMatch() : void
- Test call number match
- testSubjectExactMatch() : void
- Test search term that is an exact match for a subject specialty
- testSubjectLooseMatch() : void
- Test search term that is a loose match for a subject specialty
- testSubjectSubstring() : void
- Test search term that is a substring of a subject specialty
- buildProfile() : LibGuidesProfile
- Build a partially mocked LibGuidesProfile object
- buildQueryResults() : Results
- Build a partially mocked Results object for a given query string
- 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).
Properties
$cacheAdapter
Cache adapter object
protected
StorageInterface
$cacheAdapter
$connector
LibGuides connection object
protected
LibGuides
$connector
$libGuidesProfile
LibGuidesProfile object
protected
LibGuidesProfile
$libGuidesProfile
Methods
setUp()
Set up mocks for tests.
public
setUp() : void
Return values
void —testCallNumberMatch()
Test call number match
public
testCallNumberMatch() : void
Return values
void —testSubjectExactMatch()
Test search term that is an exact match for a subject specialty
public
testSubjectExactMatch() : void
Return values
void —testSubjectLooseMatch()
Test search term that is a loose match for a subject specialty
public
testSubjectLooseMatch() : void
Return values
void —testSubjectSubstring()
Test search term that is a substring of a subject specialty
public
testSubjectSubstring() : void
Return values
void —buildProfile()
Build a partially mocked LibGuidesProfile object
protected
buildProfile(Config $config) : LibGuidesProfile
Parameters
- $config : Config
-
The config object
Return values
LibGuidesProfile —buildQueryResults()
Build a partially mocked Results object for a given query string
protected
buildQueryResults(string $queryString[, array<string|int, mixed> $facets = [] ]) : Results
Parameters
- $queryString : string
-
The query string
- $facets : array<string|int, mixed> = []
-
The result facets
Return values
Results —The Results object
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.