/** * Test getting the current time. * Asserting that this call equals time() would make the test very brittle. * This is why we only check against the return type here. */ public function testCurrent() { $testTime = new SystemTime(); $currentTime = $testTime->current(); $this->assertInternalType('int', $currentTime); $this->assertGreaterThan(0, $currentTime); }
public function current() { $this->updateQueue(); if (isset($this->permanentCurrent)) { return $this->permanentCurrent; } if (isset($this->upcomingCurrent)) { return $this->upcomingCurrent; } return parent::current(); }