/** * Returns a new DateTime object. * * @param Date $date * @param Time $time */ public function __construct(Date $date, Time $time = null) { $this->date = $date; if (null === $time) { $time = Time::zero(); } $this->time = $time; }
public function testZero() { $time = Time::zero(); $this->assertEquals('0:00:00', \strval($time)); }
public function testNullTime() { $date = new Date(new Year(2013), Month::DECEMBER(), new MonthDay(21)); $dateTime = new DateTime($date); $this->assertTrue(Time::zero()->sameValueAs($dateTime->getTime())); }