Пример #1
0
 /**
  * Tests isOutdated()
  * 
  * @dataProvider provideTestIsOutdated
  * @param string $mtime file time
  * @param string $time current time
  * @param bool $expectedIsOutdated
  * @see UpdatePlan::isOutdated()
  */
 public function testIsOutdated($mtime, $time, $expectedIsOutdated)
 {
     $fileUtil = new FileUtil();
     $file = tempnam($fileUtil->getTempDirectory(), 'bavtest');
     touch($file, strtotime($mtime));
     $backend = new FileDataBackend($file);
     TimeMock::setTime(strtotime($time));
     $updatePlan = new AutomaticUpdatePlan();
     $this->assertEquals($expectedIsOutdated, $updatePlan->isOutdated($backend));
     TimeMock::disable();
 }