diff --git a/apps/theming/lib/template.php b/apps/theming/lib/template.php index 01e3ca8b7c0ee..a09a854ca69fc 100644 --- a/apps/theming/lib/template.php +++ b/apps/theming/lib/template.php @@ -77,6 +77,10 @@ public function getName() { 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 b9623e437b712..1ee860f93c464 100644 --- a/apps/theming/tests/lib/TemplateTest.php +++ b/apps/theming/tests/lib/TemplateTest.php @@ -91,6 +91,27 @@ public function testGetNameWithCustom() { $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())