Skip to content

Commit

Permalink
Merge pull request #371 from nextcloud/implement-get-title
Browse files Browse the repository at this point in the history
Implement "getTitle"
  • Loading branch information
nickvergessen authored Jul 11, 2016
2 parents e8169e0 + 0fd7707 commit 77071d0
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 77071d0

Please sign in to comment.