/** * Test: Get Date Period * * @access public * @return void */ public function testGetDatePeriod() { $second = new Second(new \DateTime('2012-01-31 13:12:27')); $i = 0; foreach ($second->getDatePeriod() as $dateTime) { $i++; $this->assertEquals('2012-01-31 13:12:27', $dateTime->format('Y-m-d H:i:s')); } $this->assertSame(1, $i); }
/** * Test: Get Date Period * * @access public * @return void */ public function testGetDatePeriod() { $second = new Second(new \DateTime('2012-01-31 13:12:27'), $this->prophesize(FactoryInterface::class)->reveal()); $i = 0; foreach ($second->getDatePeriod() as $dateTime) { $i++; $this->assertEquals('2012-01-31 13:12:27', $dateTime->format('Y-m-d H:i:s')); } $this->assertSame(1, $i); }