ParamsTest
extends TestCase
in package
Blender Params Test
Tags
Table of Contents
- $blenderConfig : array<string|int, mixed>
- Blender configuration
- $config : array<string|int, mixed>
- Blender config
- $configManager : object
- Mock config manager
- $edsApiConfig : array<string|int, mixed>
- EDS API configuration
- $edsConfig : array<string|int, mixed>
- EDS configuration
- $mappings : array<string|int, mixed>
- Mappings
- $primoConfig : array<string|int, mixed>
- Primo configuration
- testBlenderFacets() : void
- Test that special blender_backend checkbox facets work as expected.
- testBlenderFilters() : void
- Test that special blender_backend filters work as expected.
- testFacetMappings() : void
- Test that facet mappings work as expected.
- testFacetsAndFilters() : void
- Test that facets and filters work as expected.
- testGetFacetLabel() : void
- Test that getFacetLabel works as expected.
- testGetSearchClassId() : void
- Test that we get the correct search class ID.
- testHiddenFilters() : void
- Test that hidden filters work as expected.
- testIgnoredFilters() : void
- Test that ignoring filters works as expected.
- testInitFromRequest() : void
- Test that initFromRequest works as expected.
- testInvalidBackend() : void
- Test that an invalid backend in configuration is handled properly.
- testSearchTypeMappings() : void
- Test that search type mappings work as expected.
- testSortMappings() : void
- Test that sort mappings work as expected.
- getConfigManager() : object
- Get mock config manager
- getParams() : Params
- Get Params class
- getParamsClassesArray() : array<string|int, mixed>
- Get params classes for an array of backends
Properties
$blenderConfig
Blender configuration
protected
array<string|int, mixed>
$blenderConfig
= ['SpecialFacets' => ['dateRange' => ['publish_date']]]
$config
Blender config
protected
array<string|int, mixed>
$config
= ['Backends' => ['Solr' => 'Local', 'Primo' => 'CDI', 'EDS' => 'EBSCO'], 'Blending' => ['initialResults' => ['Solr', 'Solr', 'Primo', 'EDS', 'Primo', 'EDS']]]
$configManager
Mock config manager
protected
object
$configManager
= null
$edsApiConfig
EDS API configuration
protected
array<string|int, mixed>
$edsApiConfig
= ['AvailableSearchCriteria' => ['AvailableSorts' => [['Id' => 'date', 'Label' => 'Date Newest']]]]
$edsConfig
EDS configuration
protected
array<string|int, mixed>
$edsConfig
= ['Sorting' => ['relevance' => 'relevance', 'date' => 'year']]
$mappings
Mappings
protected
array<string|int, mixed>
$mappings
= ['Facets' => ['Fields' => ['building' => ['Mappings' => ['Solr' => ['Field' => 'building'], 'EDS' => ['Field' => 'building', 'Hierarchical' => true, 'Values' => ['main' => '0/Main/', 'sub' => '1/Sub/Fiction/']]]], 'format' => ['Mappings' => ['Solr' => ['Field' => 'formatSolr'], 'Primo' => ['Field' => 'formatPrimo', 'Values' => ['barPrimo' => 'bar', 'bazPrimo' => 'baz', 'double1' => 'double', 'double2' => 'double']]]], 'fulltext' => ['Type' => 'boolean', 'Mappings' => ['Solr' => ['Field' => 'fulltext_boolean'], 'Primo' => ['Field' => 'pcAvailability', 'Values' => ['false' => '1'], 'DefaultValue' => 'true'], 'EDS' => ['Field' => 'LIMIT|FT', 'Values' => ['y' => '1']]]], 'publish_date' => ['Mappings' => ['Solr' => ['Field' => 'publishDate'], 'Primo' => ['Field' => 'creationdate'], 'EDS' => ['Field' => 'PublicationDate']]]]], 'Search' => ['Fields' => ['AllFields' => ['Mappings' => ['Solr' => 'AllFields', 'Primo' => 'AllFields', 'EDS' => 'AllFields']], 'Title' => ['Mappings' => ['Solr' => 'Title', 'Primo' => 'Title', 'EDS' => 'TI']]]], 'Sorting' => ['Fields' => ['relevance' => ['Mappings' => ['Solr' => 'relevance', 'Primo' => 'relevance', 'EDS' => 'relevance']], 'year' => ['Mappings' => ['Solr' => 'year', 'Primo' => 'scdate', 'EDS' => 'date']]]]]
$primoConfig
Primo configuration
protected
array<string|int, mixed>
$primoConfig
= ['Sorting' => ['relevance' => 'relevance', 'scdate' => 'year']]
Methods
testBlenderFacets()
Test that special blender_backend checkbox facets work as expected.
public
testBlenderFacets() : void
Return values
void —testBlenderFilters()
Test that special blender_backend filters work as expected.
public
testBlenderFilters() : void
Return values
void —testFacetMappings()
Test that facet mappings work as expected.
public
testFacetMappings() : void
Return values
void —testFacetsAndFilters()
Test that facets and filters work as expected.
public
testFacetsAndFilters() : void
Return values
void —testGetFacetLabel()
Test that getFacetLabel works as expected.
public
testGetFacetLabel() : void
Note: This just makes sure that things look the same as with Base\Params without exercising Blender-specific functionality.
Return values
void —testGetSearchClassId()
Test that we get the correct search class ID.
public
testGetSearchClassId() : void
Return values
void —testHiddenFilters()
Test that hidden filters work as expected.
public
testHiddenFilters() : void
Return values
void —testIgnoredFilters()
Test that ignoring filters works as expected.
public
testIgnoredFilters() : void
Return values
void —testInitFromRequest()
Test that initFromRequest works as expected.
public
testInitFromRequest() : void
Return values
void —testInvalidBackend()
Test that an invalid backend in configuration is handled properly.
public
testInvalidBackend() : void
Return values
void —testSearchTypeMappings()
Test that search type mappings work as expected.
public
testSearchTypeMappings() : void
Return values
void —testSortMappings()
Test that sort mappings work as expected.
public
testSortMappings() : void
Return values
void —getConfigManager()
Get mock config manager
protected
getConfigManager() : object
Return values
object —getParams()
Get Params class
protected
getParams([array<string|int, mixed> $config = null ][, array<string|int, mixed> $mappings = null ]) : Params
Parameters
- $config : array<string|int, mixed> = null
-
Blender configuration, overrides defaults
- $mappings : array<string|int, mixed> = null
-
Blender mappings, overrides defaults
Return values
Params —getParamsClassesArray()
Get params classes for an array of backends
protected
getParamsClassesArray() : array<string|int, mixed>