diff options
author | Julius Härtl <jus@bitgrid.net> | 2017-09-23 11:35:45 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2017-11-13 10:18:48 +0100 |
commit | d70e9059a5d08c1606d716e0c1b0e0662733b5cd (patch) | |
tree | b0ebc19c5eaf52333f3dd692abb754d47af2182a /apps/theming/tests | |
parent | 31b9fc9eaca2e16d7baef3ef7e4dfc12ba0ea45e (diff) | |
download | nextcloud-server-d70e9059a5d08c1606d716e0c1b0e0662733b5cd.tar.gz nextcloud-server-d70e9059a5d08c1606d716e0c1b0e0662733b5cd.zip |
Theming: Fix tests for favicon containing multiple sizes
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/tests')
-rw-r--r-- | apps/theming/tests/IconBuilderTest.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/theming/tests/IconBuilderTest.php b/apps/theming/tests/IconBuilderTest.php index b301fa0620d..4f5078d4c56 100644 --- a/apps/theming/tests/IconBuilderTest.php +++ b/apps/theming/tests/IconBuilderTest.php @@ -150,16 +150,22 @@ class IconBuilderTest extends TestCase { public function testGetFavicon($app, $color, $file) { $this->checkImagick(); $this->themingDefaults->expects($this->once()) + ->method('shouldReplaceIcons') + ->willReturn(true); + $this->themingDefaults->expects($this->once()) ->method('getColorPrimary') ->willReturn($color); $expectedIcon = new \Imagick(realpath(dirname(__FILE__)). "/data/" . $file); + $actualIcon = $this->iconBuilder->getFavicon($app); + $icon = new \Imagick(); - $icon->readImageBlob($this->iconBuilder->getFavicon($app)); + $icon->setFormat('ico'); + $icon->readImageBlob($actualIcon); $this->assertEquals(true, $icon->valid()); - $this->assertEquals(32, $icon->getImageWidth()); - $this->assertEquals(32, $icon->getImageHeight()); + $this->assertEquals(128, $icon->getImageWidth()); + $this->assertEquals(128, $icon->getImageHeight()); $icon->destroy(); $expectedIcon->destroy(); // FIXME: We may need some comparison of the generated and the test images @@ -170,8 +176,12 @@ class IconBuilderTest extends TestCase { * @expectedException \PHPUnit_Framework_Error_Warning */ public function testGetFaviconNotFound() { + $this->checkImagick(); $util = $this->getMockBuilder(Util::class)->disableOriginalConstructor()->getMock(); $iconBuilder = new IconBuilder($this->themingDefaults, $util); + $this->themingDefaults->expects($this->once()) + ->method('shouldReplaceIcons') + ->willReturn(true); $util->expects($this->once()) ->method('getAppIcon') ->willReturn('notexistingfile'); @@ -182,6 +192,7 @@ class IconBuilderTest extends TestCase { * @expectedException \PHPUnit_Framework_Error_Warning */ public function testGetTouchIconNotFound() { + $this->checkImagick(); $util = $this->getMockBuilder(Util::class)->disableOriginalConstructor()->getMock(); $iconBuilder = new IconBuilder($this->themingDefaults, $util); $util->expects($this->once()) @@ -194,6 +205,7 @@ class IconBuilderTest extends TestCase { * @expectedException \PHPUnit_Framework_Error_Warning */ public function testColorSvgNotFound() { + $this->checkImagick(); $util = $this->getMockBuilder(Util::class)->disableOriginalConstructor()->getMock(); $iconBuilder = new IconBuilder($this->themingDefaults, $util); $util->expects($this->once()) |