From c4f34ccc4cf3823a0ccfdbad2d20ba20c474ecce Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Mon, 27 Aug 2018 15:22:49 +0200 Subject: Theming: Fix footer tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/theming/tests/ThemingDefaultsTest.php | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'apps/theming/tests') diff --git a/apps/theming/tests/ThemingDefaultsTest.php b/apps/theming/tests/ThemingDefaultsTest.php index 87b2003ded2..5d075709dc5 100644 --- a/apps/theming/tests/ThemingDefaultsTest.php +++ b/apps/theming/tests/ThemingDefaultsTest.php @@ -262,7 +262,22 @@ class ThemingDefaultsTest extends TestCase { ['theming', 'privacyUrl', '', ''], ]); - $this->assertEquals('Name – Slogan', $this->template->getShortFooter()); + $this->assertEquals('Name – Slogan', $this->template->getShortFooter()); + } + + public function testGetShortFooterEmptyUrl() { + $this->config + ->expects($this->exactly(5)) + ->method('getAppValue') + ->willReturnMap([ + ['theming', 'url', $this->defaults->getBaseUrl(), ''], + ['theming', 'name', 'Nextcloud', 'Name'], + ['theming', 'slogan', $this->defaults->getSlogan(), 'Slogan'], + ['theming', 'imprintUrl', '', ''], + ['theming', 'privacyUrl', '', ''], + ]); + + $this->assertEquals('Name – Slogan', $this->template->getShortFooter()); } public function testGetShortFooterEmptySlogan() { @@ -277,7 +292,7 @@ class ThemingDefaultsTest extends TestCase { ['theming', 'privacyUrl', '', ''], ]); - $this->assertEquals('Name', $this->template->getShortFooter()); + $this->assertEquals('Name', $this->template->getShortFooter()); } public function testGetShortFooterImprint() { @@ -297,7 +312,7 @@ class ThemingDefaultsTest extends TestCase { ->method('t') ->willReturnArgument(0); - $this->assertEquals('Name – Slogan
Legal notice', $this->template->getShortFooter()); + $this->assertEquals('Name – Slogan
Legal notice', $this->template->getShortFooter()); } public function testGetShortFooterPrivacy() { @@ -317,7 +332,7 @@ class ThemingDefaultsTest extends TestCase { ->method('t') ->willReturnArgument(0); - $this->assertEquals('Name – Slogan
Privacy policy', $this->template->getShortFooter()); + $this->assertEquals('Name – Slogan
Privacy policy', $this->template->getShortFooter()); } public function testGetShortFooterAllLegalLinks() { @@ -337,7 +352,7 @@ class ThemingDefaultsTest extends TestCase { ->method('t') ->willReturnArgument(0); - $this->assertEquals('Name – Slogan
Legal notice · Privacy policy', $this->template->getShortFooter()); + $this->assertEquals('Name – Slogan
Legal notice · Privacy policy', $this->template->getShortFooter()); } public function invalidLegalUrlProvider() { @@ -363,7 +378,7 @@ class ThemingDefaultsTest extends TestCase { ['theming', 'privacyUrl', '', ''], ]); - $this->assertEquals('Name – Slogan', $this->template->getShortFooter()); + $this->assertEquals('Name – Slogan', $this->template->getShortFooter()); } /** @@ -382,7 +397,7 @@ class ThemingDefaultsTest extends TestCase { ['theming', 'privacyUrl', '', $invalidPrivacyUrl], ]); - $this->assertEquals('Name – Slogan', $this->template->getShortFooter()); + $this->assertEquals('Name – Slogan', $this->template->getShortFooter()); } public function testgetColorPrimaryWithDefault() { -- cgit v1.2.3