VuFind API Documentation

NotifyCommandTest extends TestCase
in package

ScheduledSearch/Notify command test.

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

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

link

Wiki

Table of Contents

$container  : MockContainer
Container for building mocks.
setup()  : void
Setup method
testNoNotifications()  : void
Test behavior when no notifications are waiting to be sent.
testNotificationsWithNewSearchResults()  : void
Test behavior when notifications are waiting to be sent and new search results exist.
testNotificationsWithNoNewSearchResults()  : void
Test behavior when notifications are waiting to be sent but no search results exist.
testNotificationsWithNoSearchResults()  : void
Test behavior when notifications are waiting to be sent but no search results exist.
testNotificationsWithUnsupportedBackend()  : void
Test behavior when notifications are waiting to be sent but an illegal backend is involved.
testNotificationWithIllegalFrequency()  : void
Test behavior when notifications are waiting to be sent but there is no matching frequency configuration.
testNotificationWithRecentExecution()  : void
Test behavior when notifications have already been sent recently.
getCommand()  : NotifyCommand
Get a notify command for testing.
getMockNotifications()  : array<string|int, mixed>
Create a list of fake notification objects.
getMockResultsManager()  : MockObject|PluginManager
Create a mock results manager.
getMockSearch()  : MockObject|Minified
Get a minified search object
getMockSearchResults()  : MockObject|Results
Get mock search results.
getMockSearchResultsSet()  : array<string|int, mixed>
Get mock search results.
getMockSearchService()  : MockObject|SearchServiceInterface
Create a mock search table that returns a list of fake notification objects.
getMockUserObject()  : MockObject|UserEntityInterface
Get a mock row representing a user.

Properties

Methods

testNoNotifications()

Test behavior when no notifications are waiting to be sent.

public testNoNotifications() : void
Return values
void

testNotificationsWithNewSearchResults()

Test behavior when notifications are waiting to be sent and new search results exist.

public testNotificationsWithNewSearchResults() : void
Return values
void

testNotificationsWithNoNewSearchResults()

Test behavior when notifications are waiting to be sent but no search results exist.

public testNotificationsWithNoNewSearchResults() : void
Return values
void

testNotificationsWithNoSearchResults()

Test behavior when notifications are waiting to be sent but no search results exist.

public testNotificationsWithNoSearchResults() : void
Return values
void

testNotificationsWithUnsupportedBackend()

Test behavior when notifications are waiting to be sent but an illegal backend is involved.

public testNotificationsWithUnsupportedBackend() : void
Return values
void

testNotificationWithIllegalFrequency()

Test behavior when notifications are waiting to be sent but there is no matching frequency configuration.

public testNotificationWithIllegalFrequency() : void
Return values
void

testNotificationWithRecentExecution()

Test behavior when notifications have already been sent recently.

public testNotificationWithRecentExecution() : void
Return values
void

getCommand()

Get a notify command for testing.

protected getCommand([array<string|int, mixed> $options = [] ]) : NotifyCommand
Parameters
$options : array<string|int, mixed> = []

Options to override

Return values
NotifyCommand

getMockNotifications()

Create a list of fake notification objects.

protected getMockNotifications([array<string|int, mixed> $overrides = [] ][, callable|null $optionsCallback = null ][, callable|null $paramsCallback = null ][, callable|null $resultsCallback = null ]) : array<string|int, mixed>
Parameters
$overrides : array<string|int, mixed> = []

Fields to override in the notification row.

$optionsCallback : callable|null = null

Callback to set expectations on options object

$paramsCallback : callable|null = null

Callback to set expectations on params object

$resultsCallback : callable|null = null

Callback to set expectations on results object

Return values
array<string|int, mixed>

getMockSearch()

Get a minified search object

protected getMockSearch([callable|null $optionsCallback = null ][, callable|null $paramsCallback = null ][, callable|null $resultsCallback = null ]) : MockObject|Minified
Parameters
$optionsCallback : callable|null = null

Callback to set expectations on options object

$paramsCallback : callable|null = null

Callback to set expectations on params object

$resultsCallback : callable|null = null

Callback to set expectations on results object

Return values
MockObject|Minified

getMockSearchResults()

Get mock search results.

protected getMockSearchResults([callable|null $optionsCallback = null ][, callable|null $paramsCallback = null ][, callable|null $resultsCallback = null ]) : MockObject|Results
Parameters
$optionsCallback : callable|null = null

Callback to set expectations on options object

$paramsCallback : callable|null = null

Callback to set expectations on params object

$resultsCallback : callable|null = null

Callback to set expectations on results object

Return values
MockObject|Results

getMockSearchResultsSet()

Get mock search results.

protected getMockSearchResultsSet([AbstractBase $record = null ]) : array<string|int, mixed>
Parameters
$record : AbstractBase = null

Record to return

Return values
array<string|int, mixed>

getMockSearchService()

Create a mock search table that returns a list of fake notification objects.

protected getMockSearchService([array<string|int, mixed> $overrides = [] ][, callable|null $optionsCallback = null ][, callable|null $paramsCallback = null ][, callable|null $resultsCallback = null ]) : MockObject|SearchServiceInterface
Parameters
$overrides : array<string|int, mixed> = []

Fields to override in the notification row.

$optionsCallback : callable|null = null

Callback to set expectations on options object

$paramsCallback : callable|null = null

Callback to set expectations on params object

$resultsCallback : callable|null = null

Callback to set expectations on results object

Return values
MockObject|SearchServiceInterface

Search results