... not knowing if \'mock\' is the right word.
Anyway, I have an inherited code-base that I\'m trying to write some tests for that are time-based. Trying not to be <
Simplest solution would be to override PHP time() function and replace it with your own version. However, you cannot replace built-in PHP functions easily (see here).
Short of that, the only way is to abstract time() call to some class/function of your own that would return the time you need for testing.
Alternatively, you could run the test system (operating system) in a virtual machine and change the time of the entire virtual computer.