/** * Create a mock config object and insert the values in $map tot the getAppValue * function. Then obtain the capabilities and extract the first few * levels in the array * * @param (string[])[] $map Map of arguments to return types for the getAppValue function in the mock * @return string[] */ private function getResults(array $map) { $stub = $this->getMockBuilder('\\OCP\\IConfig')->disableOriginalConstructor()->getMock(); $stub->method('getAppValue')->will($this->returnValueMap($map)); $cap = new Capabilities($stub); $result = $this->getFilesSharingPart($cap->getCaps()->getData()); return $result; }
/** * @return \OC_OCS_Result */ public static function getCapabilities() { $config = \OC::$server->getConfig(); $cap = new Capabilities($config); return $cap->getCaps(); }