\Cake\Chronos\TraitsTestingAidTrait

Provides methods for setting a 'test' now. This lets you retrieve pre-determined times with now().

Summary

Methods
Properties
Constants
setTestNow()
getTestNow()
hasTestNow()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

setTestNow()

setTestNow(\Cake\Chronos\ChronosInterface|string|null  $testNow = null) : void

Set the test now used by Date and Time classes provided by Chronos

Parameters

\Cake\Chronos\ChronosInterface|string|null $testNow

The instance to use for all future instances.

getTestNow()

getTestNow() : static|null

Get the test instance stored in Chronos

Returns

static|null —

the current instance used for testing or null.

hasTestNow()

hasTestNow() : boolean

Get whether or not Chronos has a test instance set.

Returns

boolean —

True if there is a test instance, otherwise false