From 996f2019f7e84453da34096a2f916a6dd0664ade Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 6 Sep 2016 11:19:15 +0200 Subject: No background and logo in 10 --- apps/theming/lib/capabilities.php | 10 +--------- apps/theming/tests/CapabilitiesTest.php | 32 ++++---------------------------- 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()); } -- cgit v1.2.3