Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-09-06 12:19:15 +0300
committerJoas Schilling <coding@schilljs.com>2016-09-06 12:26:00 +0300
commit996f2019f7e84453da34096a2f916a6dd0664ade (patch)
tree781823d22a11bc4a0c018deb99813d6096b77649
parent650dc5b39632ebce52c80963ee1443dc554a27d9 (diff)
No background and logo in 10
-rw-r--r--apps/theming/lib/capabilities.php10
-rw-r--r--apps/theming/tests/CapabilitiesTest.php32
2 files changed, 5 insertions, 37 deletions
diff --git a/apps/theming/lib/capabilities.php b/apps/theming/lib/capabilities.php
index b483cc80aed..458da3be203 100644
--- a/apps/theming/lib/capabilities.php
+++ b/apps/theming/lib/capabilities.php
@@ -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()),
],
];
}
diff --git a/apps/theming/tests/CapabilitiesTest.php b/apps/theming/tests/CapabilitiesTest.php
index d63092d4ae7..7daccc7307c 100644
--- a/apps/theming/tests/CapabilitiesTest.php
+++ b/apps/theming/tests/CapabilitiesTest.php
@@ -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());
}