diff options
author | Julius Härtl <jus@bitgrid.net> | 2017-05-18 11:45:42 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2017-05-18 11:45:42 +0300 |
commit | 489131333ab2db67d84baca623f3649336f417c1 (patch) | |
tree | f7677d41ba68954917608ae75aec943ee311f288 /apps/theming/lib/Controller | |
parent | edb5502b9d695f1eb12b58eac09d64d76339ec05 (diff) |
Inject FileAccessHelper for proper testing
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/lib/Controller')
-rw-r--r-- | apps/theming/lib/Controller/IconController.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/theming/lib/Controller/IconController.php b/apps/theming/lib/Controller/IconController.php index eb51d2d799c..5532a08c83c 100644 --- a/apps/theming/lib/Controller/IconController.php +++ b/apps/theming/lib/Controller/IconController.php @@ -50,6 +50,8 @@ class IconController extends Controller { private $iconBuilder; /** @var ImageManager */ private $imageManager; + /** @var FileAccessHelper */ + private $fileAccessHelper; /** * IconController constructor. @@ -71,7 +73,8 @@ class IconController extends Controller { ITimeFactory $timeFactory, IConfig $config, IconBuilder $iconBuilder, - ImageManager $imageManager + ImageManager $imageManager, + FileAccessHelper $fileAccessHelper ) { parent::__construct($appName, $request); @@ -81,6 +84,7 @@ class IconController extends Controller { $this->config = $config; $this->iconBuilder = $iconBuilder; $this->imageManager = $imageManager; + $this->fileAccessHelper = $fileAccessHelper; } /** @@ -139,9 +143,7 @@ class IconController extends Controller { } if($response === null) { $fallbackLogo = \OC::$SERVERROOT . '/core/img/favicon.png'; - /** @var FileAccessHelper */ - $fileAccessHelper = \OC::$server->query(FileAccessHelper::class); - $response = new DataDisplayResponse($fileAccessHelper->file_get_contents($fallbackLogo), Http::STATUS_OK, ['Content-Type' => 'image/x-icon']); + $response = new DataDisplayResponse($this->fileAccessHelper->file_get_contents($fallbackLogo), Http::STATUS_OK, ['Content-Type' => 'image/x-icon']); } $response->cacheFor(86400); $expires = new \DateTime(); @@ -176,9 +178,7 @@ class IconController extends Controller { } if($response === null) { $fallbackLogo = \OC::$SERVERROOT . '/core/img/favicon-touch.png'; - /** @var FileAccessHelper */ - $fileAccessHelper = \OC::$server->query(FileAccessHelper::class); - $response = new DataDisplayResponse($fileAccessHelper->file_get_contents($fallbackLogo), Http::STATUS_OK, ['Content-Type' => 'image/png']); + $response = new DataDisplayResponse($this->fileAccessHelper->file_get_contents($fallbackLogo), Http::STATUS_OK, ['Content-Type' => 'image/png']); } $response->cacheFor(86400); $expires = new \DateTime(); |