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