Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2017-09-11 16:03:47 +0300
committerJulius Härtl <jus@bitgrid.net>2017-09-12 10:22:57 +0300
commitb49ab065b783b3ec041ca395739d747d20e2e187 (patch)
treedaa0369e10cd7959258337d9048aac404711101a /apps/theming/tests
parent88731848c609a454aa90a533e7361bca5f4e66b8 (diff)
Move theming related imagePath logic to ThemingDefaults
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/tests')
-rw-r--r--apps/theming/tests/ThemingDefaultsTest.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/apps/theming/tests/ThemingDefaultsTest.php b/apps/theming/tests/ThemingDefaultsTest.php
index c6d1fec91dd..48099e8be0f 100644
--- a/apps/theming/tests/ThemingDefaultsTest.php
+++ b/apps/theming/tests/ThemingDefaultsTest.php
@@ -607,4 +607,36 @@ class ThemingDefaultsTest extends TestCase {
$this->assertEquals('1234567890', $this->template->getiTunesAppId());
}
+ public function dataReplaceImagePath() {
+ return [
+ ['core', 'test.png', false],
+ ['core', 'manifest.json'],
+ ['core', 'favicon.ico'],
+ ['core', 'favicon-touch.png']
+ ];
+ }
+
+ /** @dataProvider dataReplaceImagePath */
+ public function testReplaceImagePath($app, $image, $result = 'themingRoute?v=0') {
+ $cache = $this->createMock(ICache::class);
+ $cache->expects($this->any())
+ ->method('get')
+ ->with('shouldReplaceIcons')
+ ->willReturn(true);
+ $this->cacheFactory->expects($this->any())
+ ->method('create')
+ ->with('theming')
+ ->willReturn($cache);
+ $this->config
+ ->expects($this->any())
+ ->method('getAppValue')
+ ->with('theming', 'cachebuster', '0')
+ ->willReturn('0');
+ $this->urlGenerator
+ ->expects($this->any())
+ ->method('linkToRoute')
+ ->willReturn('themingRoute');
+ $this->assertEquals($result, $this->template->replaceImagePath($app, $image));
+ }
+
}