From 650ef3331a92bac717f5501b79c01e2579506499 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 29 Sep 2014 20:53:19 +0200 Subject: fix manifest test --- controller/appcontroller.php | 12 +++++------- tests/unit/controller/AppControllerTest.php | 11 +++++------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/controller/appcontroller.php b/controller/appcontroller.php index e3d86a945..eea068d24 100644 --- a/controller/appcontroller.php +++ b/controller/appcontroller.php @@ -38,13 +38,13 @@ class AppController extends Controller { /** * @NoCSRFRequired * @PublicPage - * + * * Generates a web app manifest, according to specs in: * https://developer.mozilla.org/en-US/Apps/Build/Manifest */ public function manifest() { $config = $this->appConfig->getConfig(); - + // size of the icons: 128x128 is required by FxOS for all app manifests $iconSizes = ['128', '512']; $icons = []; @@ -57,19 +57,17 @@ class AppController extends Controller { } } - $params = [ + return [ "name" => $config['name'], "description" => $config['description'], "launch_path" => $this->urlGenerator->linkToRoute( $config['id'] . '.page.index'), - "icons" => $icons, + "icons" => $icons, "developer" => [ "name" => "ownCloud community", "url" => $config['homepage'] - ], + ] ]; - - return $params; } } \ No newline at end of file diff --git a/tests/unit/controller/AppControllerTest.php b/tests/unit/controller/AppControllerTest.php index 50dcb173a..82bd7ab9c 100644 --- a/tests/unit/controller/AppControllerTest.php +++ b/tests/unit/controller/AppControllerTest.php @@ -40,9 +40,9 @@ class AppControllerTest extends \PHPUnit_Framework_TestCase { '\OCA\News\Config\AppConfig') ->disableOriginalConstructor() ->getMock(); - + $this->configData = [ - "name" => "AppTest", + "name" => "AppTest", "id" => "apptest", "description" => "This is a test app", "homepage" => "https://github.com/owncloud/test" @@ -57,12 +57,11 @@ class AppControllerTest extends \PHPUnit_Framework_TestCase { ->method('getConfig') ->will($this->returnValue($this->configData)); $result = $this->controller->manifest(); - $jsonResult = json_decode($result->render(), true); - $this->assertEquals($jsonResult['name'], + $this->assertEquals($result['name'], $this->configData['name']); - $this->assertEquals($jsonResult['description'], + $this->assertEquals($result['description'], $this->configData['description']); - $this->assertEquals($jsonResult['developer']['url'], + $this->assertEquals($result['developer']['url'], $this->configData['homepage']); } -- cgit v1.2.3