Skip to content

Commit

Permalink
Fix tests to always use absolute urls for theming images
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Mar 28, 2017
1 parent 835e602 commit 2b0ac50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/theming/lib/ThemingDefaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function getBackground() {
if(!$backgroundLogo || $file === null) {
return $this->urlGenerator->imagePath('core','background.jpg');
} else {
return $this->urlGenerator->linkToRoute('theming.Theming.getLoginBackground');
return $this->urlGenerator->linkToRouteAbsolute('theming.Theming.getLoginBackground');
}
}

Expand Down
10 changes: 5 additions & 5 deletions apps/theming/tests/ThemingDefaultsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public function testGetBackgroundCustom() {
->method('getAppValue')
->with('theming', 'backgroundMime')
->willReturn('image/svg+xml');
$expected = $this->urlGenerator->linkToRoute('theming.Theming.getLoginBackground');
$expected = $this->urlGenerator->linkToRouteAbsolute('theming.Theming.getLoginBackground');
$this->assertEquals($expected, $this->template->getBackground());
}

Expand All @@ -440,7 +440,7 @@ public function testGetLogoDefault() {
->method('getAppValue')
->with('theming', 'logoMime')
->willReturn('');
$this->assertEquals('http://localhost/core/img/logo.svg', $this->template->getLogo());
$this->assertEquals($this->urlGenerator->getAbsoluteURL('/core/img/logo.svg'), $this->template->getLogo());
}

public function testGetLogoCustom() {
Expand All @@ -455,7 +455,7 @@ public function testGetLogoCustom() {
->method('getAppValue')
->with('theming', 'logoMime')
->willReturn('image/svg+xml');
$this->assertEquals('http://localhost/index.php/apps/theming/logo', $this->template->getLogo());
$this->assertEquals($this->urlGenerator->getAbsoluteURL('index.php/apps/theming/logo'), $this->template->getLogo());
}

public function testGetScssVariablesCached() {
Expand All @@ -481,8 +481,8 @@ public function testGetScssVariables() {
->willReturn($folder);
$expected = [
'theming-cachebuster' => '\'0\'',
'image-logo' => '\'http://localhost/index.php/apps/theming/logo\'',
'image-login-background' => '\'/index.php/apps/theming/loginbackground\'',
'image-logo' => '\'' . $this->urlGenerator->getAbsoluteURL('index.php/apps/theming/logo') . '\'',
'image-login-background' => '\'' . $this->urlGenerator->getAbsoluteURL('index.php/apps/theming/loginbackground') . '\'',
'color-primary' => '#000000',
'color-primary-text' => '#ffffff'

Expand Down

0 comments on commit 2b0ac50

Please sign in to comment.