Esempio n. 1
0
 /**
  * Test: Current Minute
  *
  * @access public
  * @return void
  */
 public function testCurrentMinute()
 {
     $currentDateTime = new \DateTime();
     $otherDateTime = clone $currentDateTime;
     $otherDateTime->add(new \DateInterval('PT5M'));
     $currentMinute = new Minute(new \DateTime(date('Y-m-d H:i')));
     $otherMinute = $currentMinute->getNext();
     $this->assertTrue($currentMinute->contains($currentDateTime));
     $this->assertFalse($currentMinute->contains($otherDateTime));
     $this->assertFalse($otherMinute->contains($currentDateTime));
 }
Esempio n. 2
0
 public function testCurrentMinute()
 {
     $currentDateTime = new \DateTime();
     $otherDateTime = clone $currentDateTime;
     $otherDateTime->add(new \DateInterval('PT5M'));
     $currentMinute = new Minute(new \DateTime(date('Y-m-d H:i')), $this->prophesize(FactoryInterface::class)->reveal());
     $otherMinute = $currentMinute->getNext();
     $this->assertTrue($currentMinute->contains($currentDateTime));
     $this->assertFalse($currentMinute->contains($otherDateTime));
     $this->assertFalse($otherMinute->contains($currentDateTime));
 }