Esempio n. 1
0
 /**
  * @covers CSanquer\FakeryGenerator\Model\Config::getMaxTimestamp
  * @covers CSanquer\FakeryGenerator\Model\Config::setMaxTimestamp
  * @covers CSanquer\FakeryGenerator\Model\Config::updateVariableMaxTimestamp
  * @dataProvider providerGetSetMaxTimestamp
  */
 public function testGetSetMaxTimestamp($maxTimestamp, $expected)
 {
     $dateInit = $this->config->getMaxTimestamp();
     $this->assertInstanceOf('\\DateTime', $dateInit);
     $this->assertEquals(time(), $dateInit->format('U'), 'The maximum timestamp is not the current timestamp', 30);
     $this->assertInstanceOf('\\CSanquer\\FakeryGenerator\\Model\\Config', $this->config->setMaxTimestamp($maxTimestamp));
     $date = $this->config->getMaxTimestamp();
     $this->assertInstanceOf('\\DateTime', $date);
     if ($expected === null) {
         $this->assertEquals(time(), $date->format('U'), 'The maximum timestamp is not the current timestamp', 30);
     } else {
         $this->assertEquals($expected, $date);
     }
 }