Пример #1
0
 public function testGivesATimeAFewSecondsInThePast()
 {
     $original = $this->getMock('Onebip\\UTCClock');
     $clock = new DelayedUTCClock($original, 10);
     $original->expects($this->once())->method('current')->will($this->returnValue(UTCDateTime::fromTimestamp(10000018)));
     $this->assertEquals(UTCDateTime::fromTimestamp(10000008), $clock->current());
 }
Пример #2
0
 public function testFromStringFactoryMethod()
 {
     $expectedDate = UTCDateTime::fromTimestamp(0);
     $actualDate = UTCDateTime::fromString('1970-01-01');
     $this->assertEquals($expectedDate, $actualDate);
 }