Ejemplo n.º 1
0
 public function test_leap_years()
 {
     $this->assertTrue(GeorgianDate::isLeapYear(2000));
     $this->assertFalse(GeorgianDate::isLeapYear(1100));
     $this->assertFalse(GeorgianDate::isLeapYear(1101));
     $this->assertFalse(GeorgianDate::isLeapYear(1102));
     $this->assertFalse(GeorgianDate::isLeapYear(1103));
     $this->assertTrue(GeorgianDate::isLeapYear(1104));
 }
Ejemplo n.º 2
0
 /**
  * @throws \Exception
  * @test
  * @group brute_force
  */
 public function brute_force_test_from_and_to_integer()
 {
     for ($i = 1; $i < 1039828; $i++) {
         $this->assertEquals($i, GeorgianDate::fromInteger($i)->toInteger());
     }
 }
Ejemplo n.º 3
0
 /**
  * @param GeorgianDate $gDate
  * @return DateTime
  */
 public static function georgianToDateTime(GeorgianDate $gDate)
 {
     return DateTime::createFromFormat('Y-m-d', $gDate->getYear() . '-' . $gDate->getMonth() . '-' . $gDate->getDay());
 }