/** * 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; }
/** * @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); }