public function testNoTimeZoneGivenPullsFromPHPConfig() { ini_set('date.timezone', 'America/Detroit'); $expected = new TimePoint(2001, 3, 30, 0, 0, 0, 'America/Detroit'); $clock = new Clock('2001-03-30 00:00:00'); $actual = $clock->read(); $this->assertSame($expected->compare($actual), 0); }
public function testCompareCloseTimePointsShouldShowNotEqual() { $expected = -1; $first = new TimePoint(1986, 1, 26, 11, 38, 0, 'America/Detroit'); $second = new TimePoint(1986, 1, 26, 11, 39, 13, 'America/Detroit'); $actual = $first->compare($second); $this->assertSame($expected, $actual); }