Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix theming tests
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and nickvergessen committed Apr 25, 2017
commit bc1efdf2e1c0744748e03b1552a9b8234e509d2f
2 changes: 1 addition & 1 deletion apps/theming/lib/ThemingDefaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function getBackground() {
return $this->urlGenerator->imagePath('core','background.jpg');
}

return $this->urlGenerator->linkToRoute('theming.Theming.getLoginBackground');
return $this->urlGenerator->linkToRouteAbsolute('theming.Theming.getLoginBackground');
}


Expand Down
41 changes: 12 additions & 29 deletions apps/theming/tests/ThemingDefaultsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,26 +421,17 @@ public function testGetBackgroundDefault() {
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());
}
Expand Down Expand Up @@ -471,31 +462,22 @@ public function testGetLogoDefault() {
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());
}
Expand All @@ -508,10 +490,11 @@ public function testGetScssVariablesCached() {
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);
Expand Down