Exemplo n.º 1
0
 /**
  * Test the creation methods.
  */
 function test_creation()
 {
     $epochMonth = Month::epoch();
     $this->assertEqual(strtolower(get_class($epochMonth)), 'month');
     $this->assertEqual($epochMonth->dayOfMonth(), 1);
     $this->assertEqual($epochMonth->dayOfYear(), 1);
     $this->assertEqual($epochMonth->daysInMonth(), 31);
     $this->assertEqual($epochMonth->startMonthIndex(), 1);
     $this->assertEqual($epochMonth->startMonthName(), 'January');
     $this->assertEqual($epochMonth->startMonthAbbreviation(), 'Jan');
     $duration = $epochMonth->duration();
     $this->assertTrue($duration->isEqualTo(Duration::withDays(31)));
 }