Ejemplo n.º 1
0
 public function testHowToKnowIfADateIsAfterBeforeEqualToAnOther()
 {
     $jan1 = new Date(2013, 1, 1);
     $this->assertTrue($jan1->isBefore(new Date(2013, 1, 2)));
     $this->assertTrue($jan1->isAfter(new Date(2012, 12, 31)));
     $this->assertTrue($jan1->isEquals($jan1));
 }
Ejemplo n.º 2
0
 public function testHowToKnowIfItIsBeforeAfterEqualAGivenDate()
 {
     $timepoint = new TimePoint(2013, 3, 12, 18, 27);
     $datebefore = new Date(2013, 1, 1);
     $dateafter = new Date(2013, 8, 15);
     $dateequal = new Date(2013, 3, 12);
     $this->assertEquals(true, $datebefore->isBefore($timepoint->getDate()));
     $this->assertEquals(true, $dateafter->isAfter($timepoint->getDate()));
     $this->assertEquals(true, $dateequal->isEquals($timepoint->getDate()));
 }