summaryrefslogtreecommitdiffstats
path: root/tests/lib/appframework/http/JSONResponseTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/appframework/http/JSONResponseTest.php')
-rw-r--r--tests/lib/appframework/http/JSONResponseTest.php10
1 files changed, 10 insertions, 0 deletions
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());
+ }
+
}