Skip to content

Commit

Permalink
theming tests need to be fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
MorrisJobke committed Jul 29, 2016
1 parent 5bc34c2 commit 176fbf9
Showing 1 changed file with 65 additions and 2 deletions.
67 changes: 65 additions & 2 deletions apps/theming/tests/lib/controller/ThemingControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,33 @@ public function testGetLoginBackground() {
}

public function testGetStylesheetWithOnlyColor() {
$this->config
->expects($this->at(0))
->method('getAppValue')
->with('theming', 'cachebuster', '0')
->willReturn('0');
$this->config
->expects($this->at(1))
->method('getAppValue')
->with('theming', 'color', '')
->willReturn('#000');
$this->config
->expects($this->at(2))
->method('getAppValue')
->with('theming', 'logoMime', '')
->willReturn('');
$this->config
->expects($this->at(3))
->method('getAppValue')
->with('theming', 'backgroundMime', '')
->willReturn('');

$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #000}', 'style', 'text/css');
$expected->cacheFor(3600);
@$this->assertEquals($expected, $this->themingController->getStylesheet());
}

public function testGetStylesheetWithOnlyColorInvert() {
$this->config
->expects($this->at(0))
->method('getAppValue')
Expand All @@ -326,7 +353,7 @@ public function testGetStylesheetWithOnlyColor() {
->with('theming', 'backgroundMime', '')
->willReturn('');

$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header {background-color: #fff}', 'style', 'text/css');
$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #fff}', 'style', 'text/css');
$expected->cacheFor(3600);
@$this->assertEquals($expected, $this->themingController->getStylesheet());
}
Expand Down Expand Up @@ -416,7 +443,43 @@ public function testGetStylesheetWithAllCombined() {
->with('theming', 'backgroundMime', '')
->willReturn('image/png');

$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header {background-color: #abc}#header .logo {
$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #abc}#header .logo {
background-image: url(\'./logo?v=0\');
background-size: contain;
}
#header .logo-icon {
background-image: url(\'./logo?v=0\');
background-size: contain;
}#body-login {
background-image: url(\'./loginbackground?v=0\');
}', 'style', 'text/css');
$expected->cacheFor(3600);
@$this->assertEquals($expected, $this->themingController->getStylesheet());
}

public function testGetStylesheetWithAllCombinedInverted() {
$this->config
->expects($this->at(0))
->method('getAppValue')
->with('theming', 'cachebuster', '0')
->willReturn('0');
$this->config
->expects($this->at(1))
->method('getAppValue')
->with('theming', 'color', '')
->willReturn('#fff');
$this->config
->expects($this->at(2))
->method('getAppValue')
->with('theming', 'logoMime', '')
->willReturn('text/svg');
$this->config
->expects($this->at(3))
->method('getAppValue')
->with('theming', 'backgroundMime', '')
->willReturn('image/png');

$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #fff}#header .logo {
background-image: url(\'./logo?v=0\');
background-size: contain;
}
Expand Down

0 comments on commit 176fbf9

Please sign in to comment.