diff options
author | Julius Haertl <jus@bitgrid.net> | 2016-09-18 20:15:06 +0200 |
---|---|---|
committer | Julius Haertl <jus@bitgrid.net> | 2016-11-18 10:23:24 +0100 |
commit | 492d0b9f9bd72591183ff8bf4e8d5f9b4aecba35 (patch) | |
tree | b275b40ab0b278ef690cf445a9e5e8baae196d8e /apps/theming/tests/IconBuilderTest.php | |
parent | 9e28a3ba120356b03063e44445a9401c3aa205f3 (diff) | |
download | nextcloud-server-492d0b9f9bd72591183ff8bf4e8d5f9b4aecba35.tar.gz nextcloud-server-492d0b9f9bd72591183ff8bf4e8d5f9b4aecba35.zip |
Caching for icon files using AppData
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/tests/IconBuilderTest.php')
-rw-r--r-- | apps/theming/tests/IconBuilderTest.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/apps/theming/tests/IconBuilderTest.php b/apps/theming/tests/IconBuilderTest.php index 03054367210..529518b30de 100644 --- a/apps/theming/tests/IconBuilderTest.php +++ b/apps/theming/tests/IconBuilderTest.php @@ -45,6 +45,15 @@ class IconBuilderTest extends TestCase { protected function setUp() { parent::setUp(); + $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock(); + $this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder')->getMock(); + $this->themingDefaults = $this->getMockBuilder('OCA\Theming\ThemingDefaults') + ->disableOriginalConstructor()->getMock(); + $this->util = new Util($this->config, $this->rootFolder); + $this->iconBuilder = new IconBuilder($this->themingDefaults, $this->util); + } + + private function checkImagick() { if(!extension_loaded('imagick')) { $this->markTestSkipped('Imagemagick is required for dynamic icon generation.'); } @@ -52,13 +61,6 @@ class IconBuilderTest extends TestCase { if (count($checkImagick->queryFormats('SVG')) < 1) { $this->markTestSkipped('No SVG provider present.'); } - - $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock(); - $this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder')->getMock(); - $this->themingDefaults = $this->getMockBuilder('OCA\Theming\ThemingDefaults') - ->disableOriginalConstructor()->getMock(); - $this->util = new Util($this->config, $this->rootFolder); - $this->iconBuilder = new IconBuilder($this->themingDefaults, $this->util); } public function dataRenderAppIcon() { @@ -78,6 +80,7 @@ class IconBuilderTest extends TestCase { * @param $file */ public function testRenderAppIcon($app, $color, $file) { + $this->checkImagick(); $this->themingDefaults->expects($this->once()) ->method('getMailHeaderColor') ->willReturn($color); @@ -102,6 +105,7 @@ class IconBuilderTest extends TestCase { * @param $file */ public function testGetTouchIcon($app, $color, $file) { + $this->checkImagick(); $this->themingDefaults->expects($this->once()) ->method('getMailHeaderColor') ->willReturn($color); @@ -127,6 +131,7 @@ class IconBuilderTest extends TestCase { * @param $file */ public function testGetFavicon($app, $color, $file) { + $this->checkImagick(); $this->themingDefaults->expects($this->once()) ->method('getMailHeaderColor') ->willReturn($color); |