summaryrefslogtreecommitdiffstats
path: root/apps/theming/tests/ThemingDefaultsTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/theming/tests/ThemingDefaultsTest.php')
-rw-r--r--apps/theming/tests/ThemingDefaultsTest.php44
1 files changed, 12 insertions, 32 deletions
diff --git a/apps/theming/tests/ThemingDefaultsTest.php b/apps/theming/tests/ThemingDefaultsTest.php
index 843c1d34f9e..d0dc6587f74 100644
--- a/apps/theming/tests/ThemingDefaultsTest.php
+++ b/apps/theming/tests/ThemingDefaultsTest.php
@@ -391,24 +391,14 @@ class ThemingDefaultsTest extends TestCase {
}
public function testGetBackgroundDefault() {
- $this->appData->expects($this->once())
- ->method('getFolder')
- ->willThrowException(new NotFoundException());
- $this->config
- ->expects($this->at(0))
- ->method('getAppValue')
- ->with('theming', 'backgroundMime')
- ->willReturn('');
$this->config
- ->expects($this->at(1))
+ ->expects($this->once())
->method('getAppValue')
->with('theming', 'cachebuster', '0')
->willReturn('0');
- $this->appData
- ->expects($this->once())
- ->method('getFolder')
- ->with('images')
- ->willThrowException(new \Exception());
+ $this->util->expects($this->once())
+ ->method('isBackgroundThemed')
+ ->willReturn(false);
$this->urlGenerator->expects($this->once())
->method('imagePath')
->with('core', 'background.png')
@@ -417,24 +407,14 @@ 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);
- $this->appData->expects($this->once())
- ->method('getFolder')
- ->willReturn($folder);
$this->config
- ->expects($this->at(0))
- ->method('getAppValue')
- ->with('theming', 'backgroundMime', false)
- ->willReturn('image/svg+xml');
- $this->config
- ->expects($this->at(1))
+ ->expects($this->once())
->method('getAppValue')
->with('theming', 'cachebuster', '0')
->willReturn('0');
+ $this->util->expects($this->once())
+ ->method('isBackgroundThemed')
+ ->willReturn(true);
$this->urlGenerator->expects($this->once())
->method('linkToRoute')
->with('theming.Theming.getLoginBackground')
@@ -513,12 +493,12 @@ class ThemingDefaultsTest extends TestCase {
$this->config->expects($this->at(2))->method('getAppValue')->with('theming', 'backgroundMime', false)->willReturn('jpeg');
$this->config->expects($this->at(3))->method('getAppValue')->with('theming', 'logoMime', false)->willReturn('jpeg');
$this->config->expects($this->at(4))->method('getAppValue')->with('theming', 'cachebuster', '0')->willReturn('0');
- $this->config->expects($this->at(5))->method('getAppValue')->with('theming', 'backgroundMime', false)->willReturn('jpeg');
- $this->config->expects($this->at(6))->method('getAppValue')->with('theming', 'cachebuster', '0')->willReturn('0');
- $this->config->expects($this->at(7))->method('getAppValue')->with('theming', 'color', null)->willReturn($this->defaults->getColorPrimary());
+ $this->util->expects($this->once())->method('isBackgroundThemed')->willReturn(true);
+ $this->config->expects($this->at(5))->method('getAppValue')->with('theming', 'cachebuster', '0')->willReturn('0');
+ $this->config->expects($this->at(6))->method('getAppValue')->with('theming', 'color', null)->willReturn($this->defaults->getColorPrimary());
+ $this->config->expects($this->at(7))->method('getAppValue')->with('theming', 'color', $this->defaults->getColorPrimary())->willReturn($this->defaults->getColorPrimary());
$this->config->expects($this->at(8))->method('getAppValue')->with('theming', 'color', $this->defaults->getColorPrimary())->willReturn($this->defaults->getColorPrimary());
$this->config->expects($this->at(9))->method('getAppValue')->with('theming', 'color', $this->defaults->getColorPrimary())->willReturn($this->defaults->getColorPrimary());
- $this->config->expects($this->at(10))->method('getAppValue')->with('theming', 'color', $this->defaults->getColorPrimary())->willReturn($this->defaults->getColorPrimary());
$this->util->expects($this->any())->method('invertTextColor')->with($this->defaults->getColorPrimary())->willReturn(false);
$this->util->expects($this->any())->method('elementColor')->with($this->defaults->getColorPrimary())->willReturn('#aaaaaa');