示例#1
0
 /**
  * @throws FileParserIOException
  * @throws FileParserNotExistsException
  */
 protected function setUp()
 {
     if (!empty(self::$dataBackend)) {
         return;
     }
     $container = new FileDataBackendContainer();
     #self::$dataBackend = new PDODataBackend(PDOFactory::makePDO());
     self::$dataBackend = $container->getDataBackend();
     foreach (self::$dataBackend->getAllBanks() as $bank) {
         self::$knownBanks[$bank->getValidationType()] = $bank;
     }
 }
示例#2
0
 /**
  * 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);
 }