summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-09-29 21:00:12 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-09-29 21:00:12 +0200
commit1ca33d6b5a509ff0c4113521ab8109bc55bdc442 (patch)
treebdc8fe0d878abdeae38782d671cc16f7c47818f3
parent650ef3331a92bac717f5501b79c01e2579506499 (diff)
add author names to manifest file
-rw-r--r--controller/appcontroller.php7
-rw-r--r--tests/unit/controller/AppControllerTest.php22
2 files changed, 18 insertions, 11 deletions
diff --git a/controller/appcontroller.php b/controller/appcontroller.php
index eea068d24..138668950 100644
--- a/controller/appcontroller.php
+++ b/controller/appcontroller.php
@@ -57,6 +57,11 @@ class AppController extends Controller {
}
}
+ $authors = [];
+ foreach ($config['authors'] as $author) {
+ $authors[] = $author['name'];
+ }
+
return [
"name" => $config['name'],
"description" => $config['description'],
@@ -64,7 +69,7 @@ class AppController extends Controller {
$config['id'] . '.page.index'),
"icons" => $icons,
"developer" => [
- "name" => "ownCloud community",
+ "name" => implode(', ', $authors),
"url" => $config['homepage']
]
];
diff --git a/tests/unit/controller/AppControllerTest.php b/tests/unit/controller/AppControllerTest.php
index 82bd7ab9c..7c1f5f12a 100644
--- a/tests/unit/controller/AppControllerTest.php
+++ b/tests/unit/controller/AppControllerTest.php
@@ -42,10 +42,14 @@ class AppControllerTest extends \PHPUnit_Framework_TestCase {
->getMock();
$this->configData = [
- "name" => "AppTest",
- "id" => "apptest",
- "description" => "This is a test app",
- "homepage" => "https://github.com/owncloud/test"
+ 'name' => 'AppTest',
+ 'id' => 'apptest',
+ 'authors' => [
+ ['name' => 'john'],
+ ['name' => 'test']
+ ],
+ 'description' => 'This is a test app',
+ 'homepage' => 'https://github.com/owncloud/test'
];
$this->controller = new AppController($this->appName, $this->request,
@@ -57,12 +61,10 @@ class AppControllerTest extends \PHPUnit_Framework_TestCase {
->method('getConfig')
->will($this->returnValue($this->configData));
$result = $this->controller->manifest();
- $this->assertEquals($result['name'],
- $this->configData['name']);
- $this->assertEquals($result['description'],
- $this->configData['description']);
- $this->assertEquals($result['developer']['url'],
- $this->configData['homepage']);
+ $this->assertEquals($this->configData['name'], $result['name']);
+ $this->assertEquals($this->configData['description'], $result['description']);
+ $this->assertEquals($this->configData['homepage'], $result['developer']['url']);
+ $this->assertEquals('john, test', $result['developer']['name']);
}
} \ No newline at end of file