Skip to content

Commit

Permalink
Implement "getTitle" (#372)
Browse files Browse the repository at this point in the history
Fixes #341
  • Loading branch information
LukasReschke authored and MorrisJobke committed Jul 11, 2016
1 parent 980d900 commit 450926e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/theming/lib/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
21 changes: 21 additions & 0 deletions apps/theming/tests/lib/TemplateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 450926e

Please sign in to comment.