diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-08-03 22:19:04 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-08-03 22:19:04 +0200 |
commit | 3ecf7fce79798a368ee16cb5dc5404ba16752f56 (patch) | |
tree | de775112a5889970d9f7fdeeb16c0a02a67001e0 | |
parent | 649cc2fa898968b78e249d594e846c84c3695d8d (diff) | |
download | nextcloud-server-3ecf7fce79798a368ee16cb5dc5404ba16752f56.tar.gz nextcloud-server-3ecf7fce79798a368ee16cb5dc5404ba16752f56.zip |
Fix unit test within OCSController
-rw-r--r-- | lib/public/appframework/ocscontroller.php | 3 | ||||
-rw-r--r-- | tests/lib/appframework/controller/OCSControllerTest.php | 12 |
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/public/appframework/ocscontroller.php b/lib/public/appframework/ocscontroller.php index aa71fd8f85f..55ba518020a 100644 --- a/lib/public/appframework/ocscontroller.php +++ b/lib/public/appframework/ocscontroller.php @@ -80,7 +80,6 @@ abstract class OCSController extends ApiController { } $params = [ - 'status' => 'OK', 'statuscode' => 100, 'message' => 'OK', 'data' => [], @@ -93,7 +92,7 @@ abstract class OCSController extends ApiController { } return new OCSResponse( - $format, $params['status'], $params['statuscode'], + $format, $params['statuscode'], $params['message'], $params['data'], $params['itemscount'], $params['itemsperpage'] ); diff --git a/tests/lib/appframework/controller/OCSControllerTest.php b/tests/lib/appframework/controller/OCSControllerTest.php index 11a9d45eb92..92b092cf0e9 100644 --- a/tests/lib/appframework/controller/OCSControllerTest.php +++ b/tests/lib/appframework/controller/OCSControllerTest.php @@ -69,9 +69,11 @@ class OCSControllerTest extends \Test\TestCase { $expected = "<?xml version=\"1.0\"?>\n" . "<ocs>\n" . " <meta>\n" . - " <status>OK</status>\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" . @@ -99,9 +101,11 @@ class OCSControllerTest extends \Test\TestCase { $expected = "<?xml version=\"1.0\"?>\n" . "<ocs>\n" . " <meta>\n" . - " <status>OK</status>\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" . @@ -126,8 +130,8 @@ class OCSControllerTest extends \Test\TestCase { $this->getMock('\OCP\Security\ISecureRandom'), $this->getMock('\OCP\IConfig') )); - $expected = '{"status":"OK","statuscode":400,"message":"OK",' . - '"totalitems":"","itemsperpage":"","data":{"test":"hi"}}'; + $expected = '{"ocs":{"meta":{"status":"failure","statuscode":400,"message":"OK",' . + '"totalitems":"","itemsperpage":""},"data":{"test":"hi"}}}'; $params = [ 'data' => [ 'test' => 'hi' |