コード例 #1
0
 public function testNow()
 {
     $second = Second::now();
     $this->assertEquals(\intval(date('s')), $second->toNative());
 }
コード例 #2
0
ファイル: TimeTest.php プロジェクト: embarknow/value-objects
 public function testGetSecond()
 {
     $time = new Time(new Hour(20), new Minute(10), new Second(34));
     $day = new Second(34);
     $this->assertTrue($day->sameValueAs($time->getSecond()));
 }
コード例 #3
0
ファイル: Time.php プロジェクト: embarknow/value-objects
 /**
  * Returns current Time.
  *
  * @return self
  */
 public static function now()
 {
     $time = new static(Hour::now(), Minute::now(), Second::now());
     return $time;
 }