Example #1
0
 public function testGetHour()
 {
     $time = new Time(new Hour(20), new Minute(10), new Second(34));
     $hour = new Hour(20);
     $this->assertTrue($hour->sameValueAs($time->getHour()));
 }
Example #2
0
 public function testNow()
 {
     $hour = Hour::now();
     $this->assertEquals(date('G'), $hour->toNative());
 }
Example #3
0
 /**
  * Returns current Time.
  *
  * @return self
  */
 public static function now()
 {
     $time = new static(Hour::now(), Minute::now(), Second::now());
     return $time;
 }