From caacf0503dfc4d2e627862bc374cc236605756bb Mon Sep 17 00:00:00 2001 From: Juvenn Woo Date: Thu, 12 May 2016 17:53:57 +0800 Subject: [PATCH] Ops metadatas should return result object instead of array --- src/LeanCloud/Engine/LeanEngine.php | 2 +- tests/engine/LeanEngineTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LeanCloud/Engine/LeanEngine.php b/src/LeanCloud/Engine/LeanEngine.php index 10312c8..b1bfb00 100644 --- a/src/LeanCloud/Engine/LeanEngine.php +++ b/src/LeanCloud/Engine/LeanEngine.php @@ -376,7 +376,7 @@ protected function dispatch($method, $url) { $this->processSession(); if (strpos($pathParts["extra"], "/_ops/metadatas") === 0) { if ($this->env["useMaster"]) { - $this->renderJSON(Cloud::getKeys()); + $this->renderJSON(array("result" => Cloud::getKeys())); } else { $this->renderError("Unauthorized.", 401, 401); } diff --git a/tests/engine/LeanEngineTest.php b/tests/engine/LeanEngineTest.php index f5e591b..3a96841 100644 --- a/tests/engine/LeanEngineTest.php +++ b/tests/engine/LeanEngineTest.php @@ -66,7 +66,7 @@ public function testPingEngine() { public function testGetFuncitonMetadata() { $resp = $this->request("/1/functions/_ops/metadatas", "GET"); - $this->assertContains("hello", $resp); + $this->assertContains("hello", $resp["result"]); } public function testCloudFunctionHello() {