CustomFilterListenerTest
extends TestCase
in package
Uses
MockSearchCommandTrait
Unit tests for Custom Filter Listener.
Tags
Table of Contents
- testAttach() : void
- Test attaching listener.
- testInvertedFilterPreventsAdditionOfContent() : void
- Test inverted filter functionality (part 2) -- if the inverted filter is set, the filter should not be applied.
- testMismatchedBackendIsIgnored() : void
- Test that we don't apply changes to the wrong backend.
- testMissingInvertedFilterAddsContent() : void
- Test inverted filter functionality (part 1) -- if the inverted filter is not set, the filter should be applied.
- testRemapping() : void
- Test remapping of custom filters.
- testWrongContextIsIgnored() : void
- Test that we don't apply changes to the wrong context.
- getListener() : CustomFilterListener
- Construct a listener for testing.
- getMockBackend() : Backend
- Get a mock backend
- getMockSearchCommand() : AbstractBase
- Get a mock search command.
Methods
testAttach()
Test attaching listener.
public
testAttach() : void
Return values
void —testInvertedFilterPreventsAdditionOfContent()
Test inverted filter functionality (part 2) -- if the inverted filter is set, the filter should not be applied.
public
testInvertedFilterPreventsAdditionOfContent() : void
Return values
void —testMismatchedBackendIsIgnored()
Test that we don't apply changes to the wrong backend.
public
testMismatchedBackendIsIgnored() : void
Return values
void —testMissingInvertedFilterAddsContent()
Test inverted filter functionality (part 1) -- if the inverted filter is not set, the filter should be applied.
public
testMissingInvertedFilterAddsContent() : void
Return values
void —testRemapping()
Test remapping of custom filters.
public
testRemapping() : void
Return values
void —testWrongContextIsIgnored()
Test that we don't apply changes to the wrong context.
public
testWrongContextIsIgnored() : void
Return values
void —getListener()
Construct a listener for testing.
protected
getListener([array<string|int, mixed> $normal = [] ][, array<string|int, mixed> $inverted = [] ]) : CustomFilterListener
Parameters
- $normal : array<string|int, mixed> = []
-
Normal custom filters
- $inverted : array<string|int, mixed> = []
-
Inverted custom filters
Return values
CustomFilterListener —getMockBackend()
Get a mock backend
protected
getMockBackend([string $id = 'Solr' ]) : Backend
Parameters
- $id : string = 'Solr'
-
ID of fake backend.
Return values
Backend —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