コード例 #1
0
ファイル: DateTest.php プロジェクト: rouffj/timemachine
 public function testToDateTime()
 {
     $date = new Date(2013, 1, 1);
     $this->assertEquals(new \DateTime('2013-01-01 00:00:00'), $date->toDateTime());
 }
コード例 #2
0
ファイル: DateTest.php プロジェクト: rouffj/timemachine
 /**
  * Usecases:
  * - I want to display a date in custom format in templates.
  *
  */
 public function testHowToConvertADddTimeDateObjectIntoRegularDateTimeObject()
 {
     $jan1 = new Date(2013, 1, 1);
     $this->assertEquals(new \DateTime('2013-01-01 00:00:00'), $jan1->toDateTime());
 }