diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php index 4b9ab1e130d48..6d4b84098b156 100644 --- a/apps/theming/lib/IconBuilder.php +++ b/apps/theming/lib/IconBuilder.php @@ -53,6 +53,9 @@ public function __construct( * @return string|false image blob */ public function getFavicon($app) { + if (!$this->themingDefaults->shouldReplaceIcons()) { + return false; + } try { $favicon = new Imagick(); $favicon->setFormat("ico"); diff --git a/apps/theming/tests/IconBuilderTest.php b/apps/theming/tests/IconBuilderTest.php index 8fc0d3b62b785..1b02b74fce2a8 100644 --- a/apps/theming/tests/IconBuilderTest.php +++ b/apps/theming/tests/IconBuilderTest.php @@ -151,12 +151,15 @@ public function testGetFavicon($app, $color, $file) { ->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