Exemplo n.º 1
0
 private function freezeTimeAndWait(DateTimeInterface $frozenTime = null)
 {
     $frozenTime = DateTime::freeze($frozenTime);
     sleep(self::SLEEP_TIME);
     return $frozenTime;
 }
Exemplo n.º 2
0
 /**
  * Unfreezes time.
  */
 private function unfreezeTime()
 {
     DateTime::unfreeze();
     $this->timeFrozen = null;
 }
Exemplo n.º 3
0
 /**
  * @freezeTime yesterday
  */
 public function test_annotation_with_relative_date()
 {
     $expected = new NativeDateTime('yesterday');
     $now = DateTime::now();
     $this->assertEquals($expected, $now);
 }