コード例 #1
0
 /**
  * Returns a list of supported features
  *
  * @return string[]
  */
 public function getFeaturesList()
 {
     $featuresList = [];
     /** @var Folder $rootFolder */
     $rootFolder = $this->environment->getVirtualRootFolder();
     if ($this->isAllowedAndAvailable($rootFolder) && $this->configExists($rootFolder)) {
         try {
             $featuresList = $this->configParser->getFeaturesList($rootFolder, $this->configName);
         } catch (ConfigException $exception) {
             $featuresList = $this->buildErrorMessage($exception, $rootFolder);
         }
     }
     return $featuresList;
 }
コード例 #2
0
 /**
  * @expectedException \OCA\Gallery\Config\ConfigException
  */
 public function testGetFeaturesListWithBrokenConfig()
 {
     $folder = $this->mockFolder('home::user', 121212, []);
     $folder->method('get')->with($this->configName)->willThrowException(new \Exception('Computer says no'));
     $this->configParser->getFeaturesList($folder, $this->configName);
 }