ExpireSearchesCommandTest
extends AbstractExpireCommandTest
in package
ExpireSearchesCommand test.
Tags
Table of Contents
- $expectedMinAge : int
- Expected minimum age in error message.
- $illegalAge : int
- Age parameter to use when testing illegal age input.
- $rowLabel : string
- Label to use for rows in help messages.
- $targetClass : string
- Name of class being tested
- $validServiceClass : string
- Name of a valid service class to test with
- testIllegalAgeInput() : void
- Test an illegal age parameter.
- testSuccessfulExpiration() : void
- Test that the command expires rows correctly.
- testSuccessfulNonExpiration() : void
- Test correct behavior when no rows need to be expired.
- expectConsecutiveCalls() : InvocationStubber
- Expect consecutive calls to a mock.
- getCommand() : MockObject|AbstractExpireCommand
- Get the command class
Properties
$expectedMinAge
Expected minimum age in error message.
protected
int
$expectedMinAge
= 2
$illegalAge
Age parameter to use when testing illegal age input.
protected
int
$illegalAge
= 1
$rowLabel
Label to use for rows in help messages.
protected
string
$rowLabel
= 'searches'
$targetClass
Name of class being tested
protected
string
$targetClass
= \VuFindConsole\Command\Util\ExpireSearchesCommand::class
$validServiceClass
Name of a valid service class to test with
protected
string
$validServiceClass
= \VuFind\Db\Service\SearchService::class
Methods
testIllegalAgeInput()
Test an illegal age parameter.
public
testIllegalAgeInput() : void
Return values
void —testSuccessfulExpiration()
Test that the command expires rows correctly.
public
testSuccessfulExpiration() : void
Return values
void —testSuccessfulNonExpiration()
Test correct behavior when no rows need to be expired.
public
testSuccessfulNonExpiration() : 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 —getCommand()
Get the command class
protected
getCommand(Gateway|DeleteExpiredInterface $service, DateTime $date) : MockObject|AbstractExpireCommand
Parameters
- $service : Gateway|DeleteExpiredInterface
-
Table to process
- $date : DateTime
-
Expiration date threshold