summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-07-11 19:36:26 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-07-11 19:36:26 +0200
commit0fd770765f86d0176ea288314f547ee0f3c33a0a (patch)
tree8fe62d83daa643cbeef7790f7e1c26346de17f98
parentd15fd5cb96043f908f8fdb9e111f1c8686a0434b (diff)
downloadnextcloud-server-0fd770765f86d0176ea288314f547ee0f3c33a0a.tar.gz
nextcloud-server-0fd770765f86d0176ea288314f547ee0f3c33a0a.zip
Implement "getTitle"
Fixes https://github.com/nextcloud/server/issues/341
-rw-r--r--apps/theming/lib/template.php4
-rw-r--r--apps/theming/tests/lib/TemplateTest.php21
2 files changed, 25 insertions, 0 deletions
diff --git a/apps/theming/lib/template.php b/apps/theming/lib/template.php
index 01e3ca8b7c0..a09a854ca69 100644
--- a/apps/theming/lib/template.php
+++ b/apps/theming/lib/template.php
@@ -77,6 +77,10 @@ class Template extends \OC_Defaults {
return $this->config->getAppValue('theming', 'name', $this->name);
}
+ public function getTitle() {
+ return $this->config->getAppValue('theming', 'name', $this->name);
+ }
+
public function getEntity() {
return $this->config->getAppValue('theming', 'name', $this->name);
}
diff --git a/apps/theming/tests/lib/TemplateTest.php b/apps/theming/tests/lib/TemplateTest.php
index b9623e437b7..1ee860f93c4 100644
--- a/apps/theming/tests/lib/TemplateTest.php
+++ b/apps/theming/tests/lib/TemplateTest.php
@@ -91,6 +91,27 @@ class TemplateTest extends TestCase {
$this->assertEquals('MyCustomCloud', $this->template->getName());
}
+ public function testGetTitleWithDefault() {
+ $this->config
+ ->expects($this->once())
+ ->method('getAppValue')
+ ->with('theming', 'name', 'Nextcloud')
+ ->willReturn('Nextcloud');
+
+ $this->assertEquals('Nextcloud', $this->template->getTitle());
+ }
+
+ public function testGetTitleWithCustom() {
+ $this->config
+ ->expects($this->once())
+ ->method('getAppValue')
+ ->with('theming', 'name', 'Nextcloud')
+ ->willReturn('MyCustomCloud');
+
+ $this->assertEquals('MyCustomCloud', $this->template->getTitle());
+ }
+
+
public function testGetEntityWithDefault() {
$this->config
->expects($this->once())