AlphaBrowseTest
extends TestCase
in package
Uses
WithConsecutiveTrait
AlphaBrowse Test Class
Tags
Table of Contents
- configureTestTargetAndExpectations() : array<string|int, mixed>
- Support method to mock objects.
- testGetFromRecord() : void
- Test deriving channel information from a record driver object.
- testGetFromRecordWhenChannelTokenIsSet() : void
- Test deriving channel information from a record driver object when we have a token that does not match record driver.
- testGetFromSearch() : void
- Test deriving channel information from a search results object.
- testGetFromSearchWhenChannelsIsEmpty() : void
- Test deriving channel information from a search results object with a specific single channel to load.
- testGetFromSearchWhenMaxRecordsIsLessthanChannels() : void
- Test deriving channel information from a search results object when maxRecordsToExamine is lessthan channels.
- expectConsecutiveCalls() : InvocationStubber
- Expect consecutive calls to a mock.
- getAlphaBrowse() : array<string|int, mixed>
- Get AlphaBrowse object
- getCommandChecker() : callable
- Support method to test callbacks.
- getDriver() : TestHarness
- Get a fake record driver
Methods
configureTestTargetAndExpectations()
Support method to mock objects.
public
configureTestTargetAndExpectations([array<string|int, mixed> $options = ['maxRecordsToExamine' => 1] ][, bool $fetchFromSearchService = false ]) : array<string|int, mixed>
Parameters
- $options : array<string|int, mixed> = ['maxRecordsToExamine' => 1]
-
Set options for the provider
- $fetchFromSearchService : bool = false
-
Flag indicating test case to fetch from search service when the search results do not include object we are looking for
Return values
array<string|int, mixed> —testGetFromRecord()
Test deriving channel information from a record driver object.
public
testGetFromRecord() : void
Return values
void —testGetFromRecordWhenChannelTokenIsSet()
Test deriving channel information from a record driver object when we have a token that does not match record driver.
public
testGetFromRecordWhenChannelTokenIsSet() : void
Return values
void —testGetFromSearch()
Test deriving channel information from a search results object.
public
testGetFromSearch() : void
Return values
void —testGetFromSearchWhenChannelsIsEmpty()
Test deriving channel information from a search results object with a specific single channel to load.
public
testGetFromSearchWhenChannelsIsEmpty() : void
Return values
void —testGetFromSearchWhenMaxRecordsIsLessthanChannels()
Test deriving channel information from a search results object when maxRecordsToExamine is lessthan channels.
public
testGetFromSearchWhenMaxRecordsIsLessthanChannels() : void
Return values
void —expectConsecutiveCalls()
Expect consecutive calls to a mock.
protected
expectConsecutiveCalls(MockObject $mock, string $method, array<string|int, mixed> $expectedCalls[, mixed $returnValues = null ]) : InvocationStubber
Parameters
- $mock : MockObject
-
Mock object
- $method : string
-
Method expecting calls
- $expectedCalls : array<string|int, mixed>
-
Expected input parameters
- $returnValues : mixed = null
-
Return values to mock (either an array indexed parallel to $expectedCalls to return different values, or a single value to always return the same thing)
Return values
InvocationStubber —getAlphaBrowse()
Get AlphaBrowse object
protected
getAlphaBrowse([array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
- $options : array<string|int, mixed> = []
-
options for the provider
Return values
array<string|int, mixed> —getCommandChecker()
Support method to test callbacks.
protected
getCommandChecker([array<string|int, mixed> $args = [] ][, string $class = VuFindSearchCommandAlphabeticBrowseCommand::class ][, string $target = 'Solr' ]) : callable
Parameters
- $args : array<string|int, mixed> = []
-
Command arguments
- $class : string = VuFindSearchCommandAlphabeticBrowseCommand::class
-
Command class
- $target : string = 'Solr'
-
Target identifier
Return values
callable —getDriver()
Get a fake record driver
protected
getDriver([array<string|int, mixed> $data = [] ]) : TestHarness
Parameters
- $data : array<string|int, mixed> = []
-
Test data (solrField is only supported field)