Merge pull request #371 from nextcloud/implement-get-title

Implement "getTitle"
This commit is contained in:
Joas Schilling 2016-07-11 21:57:52 +02:00 committed by GitHub
commit 77071d07cf
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())