From 1ca33d6b5a509ff0c4113521ab8109bc55bdc442 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 29 Sep 2014 21:00:12 +0200 Subject: add author names to manifest file --- controller/appcontroller.php | 7 ++++++- tests/unit/controller/AppControllerTest.php | 22 ++++++++++++---------- 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 -- cgit v1.2.3