Example #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));
 }
Example #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()));
 }
Example #3
0
 public function testIsAfter()
 {
     $date = new Date(2012, 11, 2);
     $this->assertEquals(true, $date->isAfter(new Date(2011, 11, 25)));
     $this->assertEquals(true, $date->isAfter(new Date(2012, 10, 1)));
     $this->assertEquals(true, $date->isAfter(new Date(2012, 11, 1)));
     $this->assertEquals(false, $date->isAfter(new Date(2012, 11, 2)));
     $this->assertEquals(false, $date->isAfter(new Date(2012, 11, 5)));
     $this->assertEquals(false, $date->isAfter(new Date(2012, 12, 5)));
 }