Exemplo n.º 1
0
 /**
  * Create the federated share provider
  *
  * @return FederatedShareProvider
  */
 protected function federatedShareProvider()
 {
     if ($this->federatedProvider === null) {
         /*
          * Check if the app is enabled
          */
         $appManager = $this->serverContainer->getAppManager();
         if (!$appManager->isEnabledForUser('federatedfilesharing')) {
             return null;
         }
         /*
          * TODO: add factory to federated sharing app
          */
         $l = $this->serverContainer->getL10N('federatedfilessharing');
         $addressHandler = new AddressHandler($this->serverContainer->getURLGenerator(), $l);
         $notifications = new Notifications($addressHandler, $this->serverContainer->getHTTPClientService());
         $tokenHandler = new TokenHandler($this->serverContainer->getSecureRandom());
         $this->federatedProvider = new FederatedShareProvider($this->serverContainer->getDatabaseConnection(), $addressHandler, $notifications, $tokenHandler, $l, $this->serverContainer->getLogger(), $this->serverContainer->getRootFolder());
     }
     return $this->federatedProvider;
 }
Exemplo n.º 2
0
 /**
  * Called before executing all tests in a suite
  *
  * If the module is injected, you need to use _initialize()
  *
  * @param array $settings
  */
 public function _beforeSuite($settings = [])
 {
     $this->coreTestCase = new CoreTestCase();
     $app = new App('gallery-test-setup');
     $this->container = $app->getContainer();
     $this->server = $this->container->getServer();
     $this->rootFolder = $this->server->getRootFolder();
     $this->userManager = $this->server->getUserManager();
     /**
      * Logging hooks are missing at the moment, so we need to disable encryption
      *
      * @link https://github.com/owncloud/core/issues/18085#issuecomment-128093797
      */
     $this->server->getConfig()->setAppValue('core', 'encryption_enabled', 'no');
     // This is because the filesystem is not properly cleaned up sometimes
     $this->server->getAppManager()->disableApp('files_trashbin');
     $this->setPreviewProviders();
     $this->createTestSetup($this->userId, $this->userPassword);
     $this->createTestSetup($this->sharerUserId, $this->sharerPassword);
     $this->createShares();
 }