From 8f6ea900f2f75bfdfadb7f484ec64ac7ea78623c Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sun, 9 Mar 2014 23:01:16 +0100 Subject: Chainable Response in AppFramework --- tests/lib/appframework/http/JSONResponseTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/lib/appframework/http/JSONResponseTest.php') diff --git a/tests/lib/appframework/http/JSONResponseTest.php b/tests/lib/appframework/http/JSONResponseTest.php index 534c54cbcee..b9b7c7d6382 100644 --- a/tests/lib/appframework/http/JSONResponseTest.php +++ b/tests/lib/appframework/http/JSONResponseTest.php @@ -28,6 +28,7 @@ namespace OC\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; +use OCP\AppFramework\Http; //require_once(__DIR__ . "/../classloader.php"); @@ -95,4 +96,13 @@ class JSONResponseTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($code, $response->getStatus()); } + public function testChainability() { + $params = array('hi', 'yo'); + $this->json->setData($params) + ->setStatus(Http::STATUS_NOT_FOUND); + + $this->assertEquals(Http::STATUS_NOT_FOUND, $this->json->getStatus()); + $this->assertEquals(array('hi', 'yo'), $this->json->getData()); + } + } -- cgit v1.2.3