diff options
author | Julius Härtl <jus@bitgrid.net> | 2017-04-24 10:50:24 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-04-25 11:39:49 +0200 |
commit | bc1efdf2e1c0744748e03b1552a9b8234e509d2f (patch) | |
tree | 2287f11af518cfbd04e73f517ea581c129e4153f /apps | |
parent | 1c54463853e7bcbe857b6a874cbadd48a77bcf89 (diff) | |
download | nextcloud-server-bc1efdf2e1c0744748e03b1552a9b8234e509d2f.tar.gz nextcloud-server-bc1efdf2e1c0744748e03b1552a9b8234e509d2f.zip |
Fix theming tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/theming/lib/ThemingDefaults.php | 2 | ||||
-rw-r--r-- | apps/theming/tests/ThemingDefaultsTest.php | 41 |
2 files changed, 13 insertions, 30 deletions
diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php index e73887d6162..319474a8552 100644 --- a/apps/theming/lib/ThemingDefaults.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -169,7 +169,7 @@ class ThemingDefaults extends \OC_Defaults { return $this->urlGenerator->imagePath('core','background.jpg'); } - return $this->urlGenerator->linkToRoute('theming.Theming.getLoginBackground'); + return $this->urlGenerator->linkToRouteAbsolute('theming.Theming.getLoginBackground'); } diff --git a/apps/theming/tests/ThemingDefaultsTest.php b/apps/theming/tests/ThemingDefaultsTest.php index dfa226c403d..2fda63d4fe1 100644 --- a/apps/theming/tests/ThemingDefaultsTest.php +++ b/apps/theming/tests/ThemingDefaultsTest.php @@ -421,26 +421,17 @@ class ThemingDefaultsTest extends TestCase { public function testGetBackgroundCustom() { $folder = $this->createMock(ISimpleFolder::class); $file = $this->createMock(ISimpleFile::class); - $folder->expects($this->once())->method('getFile')->willReturn($file); + $folder->expects($this->once()) + ->method('getFile') + ->willReturn($file); $this->appData->expects($this->once()) ->method('getFolder') ->willReturn($folder); $this->config ->expects($this->once()) ->method('getAppValue') - ->with('theming', 'backgroundMime') + ->with('theming', 'backgroundMime', false) ->willReturn('image/svg+xml'); - $simpleFolder = $this->createMock(ISimpleFolder::class); - $this->appData - ->expects($this->once()) - ->method('getFolder') - ->with('images') - ->willReturn($simpleFolder); - $simpleFolder - ->expects($this->once()) - ->method('getFile') - ->with('background') - ->willReturn(''); $expected = $this->urlGenerator->linkToRouteAbsolute('theming.Theming.getLoginBackground'); $this->assertEquals($expected, $this->template->getBackground()); } @@ -471,31 +462,22 @@ class ThemingDefaultsTest extends TestCase { public function testGetLogoCustom() { $folder = $this->createMock(ISimpleFolder::class); $file = $this->createMock(ISimpleFile::class); - $folder->expects($this->once())->method('getFile')->willReturn($file); + $folder->expects($this->once()) + ->method('getFile') + ->willReturn($file); $this->appData->expects($this->once()) ->method('getFolder') ->willReturn($folder); $this->config ->expects($this->at(0)) ->method('getAppValue') - ->with('theming', 'logoMime') + ->with('theming', 'logoMime', false) ->willReturn('image/svg+xml'); $this->config ->expects($this->at(1)) ->method('getAppValue') ->with('theming', 'cachebuster', '0') ->willReturn('0'); - $simpleFolder = $this->createMock(ISimpleFolder::class); - $this->appData - ->expects($this->once()) - ->method('getFolder') - ->with('images') - ->willReturn($simpleFolder); - $simpleFolder - ->expects($this->once()) - ->method('getFile') - ->with('logo') - ->willReturn(''); $expected = $this->urlGenerator->getAbsoluteURL('index.php/apps/theming/logo') . '?v=0'; $this->assertEquals($expected, $this->template->getLogo()); } @@ -508,10 +490,11 @@ class ThemingDefaultsTest extends TestCase { public function testGetScssVariables() { $this->config->expects($this->at(0))->method('getAppValue')->with('theming', 'cachebuster', '0')->willReturn('0'); $this->config->expects($this->at(1))->method('getAppValue')->with('theming', 'logoMime', false)->willReturn('jpeg'); - $this->config->expects($this->at(2))->method('getAppValue')->with('theming', 'backgroundMime', false)->willReturn('jpeg'); - $this->config->expects($this->at(3))->method('getAppValue')->with('theming', 'color', null)->willReturn('#000000'); - $this->config->expects($this->at(4))->method('getAppValue')->with('theming', 'color', '#000')->willReturn('#000000'); + $this->config->expects($this->at(2))->method('getAppValue')->with('theming', 'cachebuster', '0')->willReturn('0'); + $this->config->expects($this->at(3))->method('getAppValue')->with('theming', 'backgroundMime', false)->willReturn('jpeg'); + $this->config->expects($this->at(4))->method('getAppValue')->with('theming', 'color', null)->willReturn('#000000'); $this->config->expects($this->at(5))->method('getAppValue')->with('theming', 'color', '#000')->willReturn('#000000'); + $this->config->expects($this->at(6))->method('getAppValue')->with('theming', 'color', '#000')->willReturn('#000000'); $this->util->expects($this->any())->method('invertTextColor')->with('#000000')->willReturn(false); $this->cache->expects($this->once())->method('get')->with('getScssVariables')->willReturn(null); |