Beispiel #1
0
 /**
  * @NoAdminRequired
  *
  * Returns an app configuration array
  *
  * @param bool $extraMediaTypes
  *
  * @return array <string,null|array>
  */
 private function getConfig($extraMediaTypes = false)
 {
     $features = $this->configService->getFeaturesList();
     //$this->logger->debug("Features: {features}", ['features' => $features]);
     $nativeSvgSupport = $this->isNativeSvgActivated($features);
     $mediaTypes = $this->configService->getSupportedMediaTypes($extraMediaTypes, $nativeSvgSupport);
     return ['features' => $features, 'mediatypes' => $mediaTypes];
 }
Beispiel #2
0
 /**
  * @NoAdminRequired
  *
  * Returns an app configuration array
  *
  * @param bool $extraMediaTypes
  *
  * @return array <string,null|array>
  */
 private function getConfig($extraMediaTypes = false)
 {
     $features = $this->configService->getFeaturesList();
     //$this->logger->debug("Features: {features}", ['features' => $features]);
     $nativeSvgSupport = $this->isNativeSvgActivated($features);
     $mediaTypes = $this->configService->getSupportedMediaTypes($extraMediaTypes, $nativeSvgSupport);
     $enablePreviews = \OC::$server->getConfig()->getSystemValue('enable_previews', true);
     return ['features' => $features, 'mediatypes' => $mediaTypes, 'enablePreviews' => $enablePreviews];
 }
 public function testGetSupportedMediaTypesWithBrokenPreviewSystem()
 {
     // We only support 1 media type: GIF
     self::invokePrivate($this->service, 'baseMimeTypes', [['image/gif']]);
     // Unfortunately, the GIF preview is broken
     $this->mockIsMimeSupportedWithBrokenSystem('image/gif');
     $response = $this->service->getSupportedMediaTypes(false, false);
     // 1-1 = 0
     $this->assertEmpty($response);
 }