Ejemplo n.º 1
0
 /**
  * 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;
 }
Ejemplo n.º 2
0
 /**
  * @return \OC_OCS_Result
  */
 public static function getCapabilities()
 {
     $config = \OC::$server->getConfig();
     $cap = new Capabilities($config);
     return $cap->getCaps();
 }