HideFacetValueListenerTest
extends TestCase
in package
Uses
MockSearchCommandTrait
Unit tests for Hide Facet Value Listener.
Tags
Table of Contents
- testAttach() : void
- Test attaching listener.
- testHideFacet() : void
- Test actual functionality of listener, with "hide facet" setting.
- testHideFacetsAndShowFacets() : void
- Test actual functionality of listener, with "hide facets" and "show facets" settings, demonstrating that both can be applied together (though doing so in a real-world scenario would not really make sense).
- testShowFacets() : void
- Test actual functionality of listener, with "show facets" setting.
- getFacets() : array<string|int, mixed>
- Get a facet array for testing.
- getListener() : HideFacetValueListener
- Construct a listener for testing.
- getMockBackend() : Backend
- Get a mock backend
- getMockResult() : RecordCollection
- Construct a mock Solr result object.
- getMockSearchCommand() : AbstractBase
- Get a mock search command.
Methods
testAttach()
Test attaching listener.
public
testAttach() : void
Return values
void —testHideFacet()
Test actual functionality of listener, with "hide facet" setting.
public
testHideFacet() : void
Return values
void —testHideFacetsAndShowFacets()
Test actual functionality of listener, with "hide facets" and "show facets" settings, demonstrating that both can be applied together (though doing so in a real-world scenario would not really make sense).
public
testHideFacetsAndShowFacets() : void
Return values
void —testShowFacets()
Test actual functionality of listener, with "show facets" setting.
public
testShowFacets() : void
Return values
void —getFacets()
Get a facet array for testing.
protected
getFacets() : array<string|int, mixed>
Return values
array<string|int, mixed> —getListener()
Construct a listener for testing.
protected
getListener([array<string|int, mixed> $hideFacetValues = [] ][, array<string|int, mixed> $showFacetValues = [] ]) : HideFacetValueListener
Parameters
- $hideFacetValues : array<string|int, mixed> = []
-
Assoc. array of field name => values to exclude from display (see also next param).
- $showFacetValues : array<string|int, mixed> = []
-
Assoc. array of field name => values to exclusively show in display (see also previous param).
Return values
HideFacetValueListener —getMockBackend()
Get a mock backend
protected
getMockBackend([string $id = 'Solr' ]) : Backend
Parameters
- $id : string = 'Solr'
-
ID of fake backend.
Return values
Backend —getMockResult()
Construct a mock Solr result object.
protected
getMockResult() : RecordCollection
Return values
RecordCollection —getMockSearchCommand()
Get a mock search command.
protected
getMockSearchCommand([ParamBag $params = null ][, mixed $context = null ][, string $backendId = 'foo' ][, mixed $result = null ]) : AbstractBase
Parameters
- $params : ParamBag = null
-
Parameters for command to return
- $context : mixed = null
-
Context for command to return
- $backendId : string = 'foo'
-
Backend ID for command
- $result : mixed = null
-
Result to return