public function testGetTime()
 {
     $date = new Date(new Year(2013), Month::DECEMBER(), new MonthDay(3));
     $time = new Time(new Hour(20), new Minute(50), new Second(10));
     $dateTime = new DateTime($date, $time);
     $this->assertTrue($time->sameValueAs($dateTime->getTime()));
 }
Exemple #2
0
 /**
  * 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;
 }
Exemple #3
0
 public function testToString()
 {
     $time = new Time(new Hour(20), new Minute(10), new Second(34));
     $this->assertEquals('20:10:34', $time->__toString());
 }