/** * 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)); }
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)); }