... 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 <
Disclaimer: I wrote this library.
You can mock time for test using Clock from ouzo-goodies.
In code use simply:
$time = Clock::now();
Then in tests:
Clock::freeze('2014-01-07 12:34'); $result = Class::getCurrDate(); $this->assertEquals('2014-01-07', $result);