diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-04-08 22:42:43 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-04-08 22:42:43 +0200 |
commit | 73ac3d0fcd3aebade34efdbca6f48520b75729d6 (patch) | |
tree | cd8760ae45b22e1df96d4f78b4de2c914643823f /tests/lib/appframework/http/JSONResponseTest.php | |
parent | c1345d3a2d7ba18859bc836f23628322b8ebc0e0 (diff) | |
parent | a1aacc18dff11351b555304a5361a73e13684bd1 (diff) | |
download | nextcloud-server-73ac3d0fcd3aebade34efdbca6f48520b75729d6.tar.gz nextcloud-server-73ac3d0fcd3aebade34efdbca6f48520b75729d6.zip |
Merge pull request #7643 from owncloud/chainable_response
Chainable Response in AppFramework
Diffstat (limited to 'tests/lib/appframework/http/JSONResponseTest.php')
-rw-r--r-- | tests/lib/appframework/http/JSONResponseTest.php | 10 |
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()); + } + } |