VuFind API Documentation

CustomFilterListenerTest extends TestCase
in package
Uses MockSearchCommandTrait

Unit tests for Custom Filter Listener.

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Main Site

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

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

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

Return values
AbstractBase

Search results