Implement "getTitle"

Fixes https://github.com/nextcloud/server/issues/341
This commit is contained in:
Lukas Reschke 2016-07-11 19:36:26 +02:00
parent d15fd5cb96
commit 0fd770765f
No known key found for this signature in database
GPG key ID: B9F6980CF6E759B1
2 changed files with 25 additions and 0 deletions

View file

@ -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);
}

View file

@ -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())