TestingAidTrait
Provides methods for setting a 'test' now. This lets you retrieve pre-determined times with now().
Table of Contents
Methods
- getTestNow() : ChronosInterface|null
- Get the test instance stored in Chronos
- hasTestNow() : bool
- Get whether or not Chronos has a test instance set.
- setTestNow() : void
- Set the test now used by Date and Time classes provided by Chronos
Methods
getTestNow()
Get the test instance stored in Chronos
public
static getTestNow() : ChronosInterface|null
Tags
Return values
ChronosInterface|null —the current instance used for testing or null.
hasTestNow()
Get whether or not Chronos has a test instance set.
public
static hasTestNow() : bool
Tags
Return values
bool —True if there is a test instance, otherwise false
setTestNow()
Set the test now used by Date and Time classes provided by Chronos
public
static setTestNow([ChronosInterface|string|null $testNow = null ]) : void
Parameters
- $testNow : ChronosInterface|string|null = null
-
The instance to use for all future instances.