Ejemplo n.º 1
0
 public function testIsCurrent()
 {
     $currentDate = new \DateTime();
     $otherDate = clone $currentDate;
     $otherDate->add(new \DateInterval('P5D'));
     $currentDay = new Day(new \DateTime(date('Y-m-d')));
     $otherDay = $currentDay->getNext();
     $this->assertTrue($currentDay->contains($currentDate));
     $this->assertFalse($currentDay->contains($otherDate));
     $this->assertFalse($otherDay->contains($currentDate));
 }
Ejemplo n.º 2
0
 public function testCurrentDay()
 {
     $currentDate = new \DateTime();
     $otherDate = clone $currentDate;
     $otherDate->add(new \DateInterval('P5D'));
     $currentDay = new Day(new \DateTime(date('Y-m-d')), $this->prophesize(FactoryInterface::class)->reveal());
     $otherDay = $currentDay->getNext();
     $this->assertTrue($currentDay->contains($currentDate));
     $this->assertFalse($currentDay->contains($otherDate));
     $this->assertFalse($otherDay->contains($currentDate));
 }
Ejemplo n.º 3
0
 /**
  * @dataProvider providerContains
  */
 public function testContains($start, $contain, $notContain)
 {
     $day = new Day($start);
     $this->assertTrue($day->contains($contain));
     $this->assertFalse($day->contains($notContain));
 }