diff options
author | Julius Härtl <jus@bitgrid.net> | 2017-09-11 15:03:47 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2017-09-12 09:22:57 +0200 |
commit | b49ab065b783b3ec041ca395739d747d20e2e187 (patch) | |
tree | daa0369e10cd7959258337d9048aac404711101a /apps/theming/tests | |
parent | 88731848c609a454aa90a533e7361bca5f4e66b8 (diff) | |
download | nextcloud-server-b49ab065b783b3ec041ca395739d747d20e2e187.tar.gz nextcloud-server-b49ab065b783b3ec041ca395739d747d20e2e187.zip |
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.php | 32 |
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)); + } + } |