Ouzo\Utilities\Clock::freeze PHP Method

freeze() public static method

Freezes time to a specific point or current time if no time is given.
public static freeze ( null $date = null )
$date null
    public static function freeze($date = null)
    {
        self::$freeze = false;
        self::$freezeDate = $date ? new DateTime($date) : self::now();
        self::$freeze = true;
    }

Usage Example

Example #1
0
 protected function setUp()
 {
     parent::setUp();
     Clock::freeze('2014-01-01 11:11:11');
     StreamStub::register('test');
     $this->logger = new StdOutputLogger('TEST', 'default', 'test');
 }
All Usage Examples Of Ouzo\Utilities\Clock::freeze