No background and logo in 10

This commit is contained in:
Joas Schilling 2016-09-06 11:19:15 +02:00
parent b626f710c1
commit 9ac95be358
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
2 changed files with 5 additions and 37 deletions

View File

@ -36,17 +36,11 @@ class Capabilities implements ICapability {
/** @var ThemingDefaults */
protected $theming;
/** @var IURLGenerator */
protected $url;
/**
* @param ThemingDefaults $theming
* @param IURLGenerator $url
*/
public function __construct(ThemingDefaults $theming, IURLGenerator $url) {
public function __construct(ThemingDefaults $theming) {
$this->theming = $theming;
$this->url = $url;
}
/**
@ -61,8 +55,6 @@ class Capabilities implements ICapability {
'url' => $this->theming->getBaseUrl(),
'slogan' => $this->theming->getSlogan(),
'color' => $this->theming->getMailHeaderColor(),
'logo' => $this->url->getAbsoluteURL($this->theming->getLogo()),
'background' => $this->url->getAbsoluteURL($this->theming->getBackground()),
],
];
}

View File

@ -36,9 +36,6 @@ class CapabilitiesTest extends TestCase {
/** @var ThemingDefaults|\PHPUnit_Framework_MockObject_MockObject */
protected $theming;
/** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */
protected $url;
/** @var Capabilities */
protected $capabilities;
@ -48,29 +45,23 @@ class CapabilitiesTest extends TestCase {
$this->theming = $this->getMockBuilder('OCA\Theming\ThemingDefaults')
->disableOriginalConstructor()
->getMock();
$this->url = $this->getMockBuilder('OCP\IURLGenerator')
->getMock();
$this->capabilities = new Capabilities($this->theming, $this->url);
$this->capabilities = new Capabilities($this->theming);
}
public function dataGetCapabilities() {
return [
['name', 'url', 'slogan', 'color', 'logo', 'background', 'http://absolute/', [
['name', 'url', 'slogan', 'color', [
'name' => 'name',
'url' => 'url',
'slogan' => 'slogan',
'color' => 'color',
'logo' => 'http://absolute/logo',
'background' => 'http://absolute/background',
]],
['name1', 'url2', 'slogan3', 'color4', 'logo5', 'background6', 'http://localhost/', [
['name1', 'url2', 'slogan3', 'color4', [
'name' => 'name1',
'url' => 'url2',
'slogan' => 'slogan3',
'color' => 'color4',
'logo' => 'http://localhost/logo5',
'background' => 'http://localhost/background6',
]],
];
}
@ -81,12 +72,9 @@ class CapabilitiesTest extends TestCase {
* @param string $url
* @param string $slogan
* @param string $color
* @param string $logo
* @param string $background
* @param string $baseUrl
* @param string[] $expected
*/
public function testGetCapabilities($name, $url, $slogan, $color, $logo, $background, $baseUrl, array $expected) {
public function testGetCapabilities($name, $url, $slogan, $color, array $expected) {
$this->theming->expects($this->once())
->method('getName')
->willReturn($name);
@ -99,18 +87,6 @@ class CapabilitiesTest extends TestCase {
$this->theming->expects($this->once())
->method('getMailHeaderColor')
->willReturn($color);
$this->theming->expects($this->once())
->method('getLogo')
->willReturn($logo);
$this->theming->expects($this->once())
->method('getBackground')
->willReturn($background);
$this->url->expects($this->exactly(2))
->method('getAbsoluteURL')
->willReturnCallback(function($url) use($baseUrl) {
return $baseUrl . $url;
});
$this->assertEquals(['theming' => $expected], $this->capabilities->getCapabilities());
}