/** * Tests automatic installation. */ public function testAutomaticUpdate() { $updatePlan = new AutomaticUpdatePlan(); $updatePlan->setNotice(false); ConfigurationRegistry::getConfiguration()->setUpdatePlan($updatePlan); $fileUtil = new FileUtil(); $container = new FileDataBackendContainer(tempnam($fileUtil->getTempDirectory(), 'bavtest')); $backend = $container->getDataBackend(); touch($backend->getFile(), strtotime("-1 year")); $this->assertTrue($updatePlan->isOutdated($backend)); $container->applyUpdatePlan($backend); $this->assertFalse($updatePlan->isOutdated($backend)); $backend->uninstall(); ConfigurationRegistry::getConfiguration()->setUpdatePlan(null); }