diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-08-11 19:37:17 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-08-11 19:37:17 +0200 |
commit | 8261ccce1be32c1467874d537240585c0d841600 (patch) | |
tree | 2b654700b2069eafbc2562e89621c748632c0e31 /tests/lib/AppFramework/Controller/OCSControllerTest.php | |
parent | 225eb27bcac1e710a4aba723483745bb3677460f (diff) | |
parent | f68f1d5f37e248aa7e5ac56e34fe79ce184ce149 (diff) | |
download | nextcloud-server-8261ccce1be32c1467874d537240585c0d841600.tar.gz nextcloud-server-8261ccce1be32c1467874d537240585c0d841600.zip |
Merge branch 'master' into implement_712
Diffstat (limited to 'tests/lib/AppFramework/Controller/OCSControllerTest.php')
-rw-r--r-- | tests/lib/AppFramework/Controller/OCSControllerTest.php | 57 |
1 files changed, 5 insertions, 52 deletions
diff --git a/tests/lib/AppFramework/Controller/OCSControllerTest.php b/tests/lib/AppFramework/Controller/OCSControllerTest.php index 7dcbd189cd5..9c9214181a4 100644 --- a/tests/lib/AppFramework/Controller/OCSControllerTest.php +++ b/tests/lib/AppFramework/Controller/OCSControllerTest.php @@ -75,8 +75,8 @@ class OCSControllerTest extends \Test\TestCase { $expected = "<?xml version=\"1.0\"?>\n" . "<ocs>\n" . " <meta>\n" . - " <status>failure</status>\n" . - " <statuscode>400</statuscode>\n" . + " <status>ok</status>\n" . + " <statuscode>100</statuscode>\n" . " <message>OK</message>\n" . " <totalitems></totalitems>\n" . " <itemsperpage></itemsperpage>\n" . @@ -86,54 +86,12 @@ class OCSControllerTest extends \Test\TestCase { " </data>\n" . "</ocs>\n"; - $params = [ - 'data' => [ - 'test' => 'hi' - ], - 'statuscode' => 400 - ]; + $params = new DataResponse(['test' => 'hi']); $out = $controller->buildResponse($params, 'xml')->render(); $this->assertEquals($expected, $out); } - - public function testXMLDataResponse() { - $controller = new ChildOCSController('app', new Request( - [], - $this->getMockBuilder('\OCP\Security\ISecureRandom') - ->disableOriginalConstructor() - ->getMock(), - $this->getMockBuilder('\OCP\IConfig') - ->disableOriginalConstructor() - ->getMock() - )); - $expected = "<?xml version=\"1.0\"?>\n" . - "<ocs>\n" . - " <meta>\n" . - " <status>failure</status>\n" . - " <statuscode>400</statuscode>\n" . - " <message>OK</message>\n" . - " <totalitems></totalitems>\n" . - " <itemsperpage></itemsperpage>\n" . - " </meta>\n" . - " <data>\n" . - " <test>hi</test>\n" . - " </data>\n" . - "</ocs>\n"; - - $params = new DataResponse([ - 'data' => [ - 'test' => 'hi' - ], - 'statuscode' => 400 - ]); - - $out = $controller->buildResponse($params, 'xml')->render(); - $this->assertEquals($expected, $out); - } - - public function testJSON() { $controller = new ChildOCSController('app', new Request( [], @@ -144,14 +102,9 @@ class OCSControllerTest extends \Test\TestCase { ->disableOriginalConstructor() ->getMock() )); - $expected = '{"ocs":{"meta":{"status":"failure","statuscode":400,"message":"OK",' . + $expected = '{"ocs":{"meta":{"status":"ok","statuscode":100,"message":"OK",' . '"totalitems":"","itemsperpage":""},"data":{"test":"hi"}}}'; - $params = [ - 'data' => [ - 'test' => 'hi' - ], - 'statuscode' => 400 - ]; + $params = new DataResponse(['test' => 'hi']); $out = $controller->buildResponse($params, 'json')->render(); $this->assertEquals($expected, $out); |