From 492d0b9f9bd72591183ff8bf4e8d5f9b4aecba35 Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Sun, 18 Sep 2016 20:15:06 +0200 Subject: Caching for icon files using AppData Signed-off-by: Julius Haertl --- apps/theming/tests/IconBuilderTest.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'apps/theming/tests/IconBuilderTest.php') 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); -- cgit v1.2.3