Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-09-23 16:16:41 +0300
committerRobin McCorkell <rmccorkell@owncloud.com>2015-09-23 16:16:41 +0300
commitebe9bea709dd74e3cab3bbb8e9b1ea141bdf90bf (patch)
tree15dc5404c830e62fe76a3bfafe67d131816c9140 /tests
parent0b0daa83515b9b7e7a626b191f3547133aa27e01 (diff)
Unit test for preventing warning decoding content
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/appframework/http/RequestTest.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/lib/appframework/http/RequestTest.php b/tests/lib/appframework/http/RequestTest.php
index deb28909869..5140e37e515 100644
--- a/tests/lib/appframework/http/RequestTest.php
+++ b/tests/lib/appframework/http/RequestTest.php
@@ -202,6 +202,27 @@ class RequestTest extends \Test\TestCase {
$this->assertEquals('Joey', $request['nickname']);
}
+ public function testNotJsonPost() {
+ global $data;
+ $data = 'this is not valid json';
+ $vars = array(
+ 'method' => 'POST',
+ 'server' => array('CONTENT_TYPE' => 'application/json; utf-8')
+ );
+
+ $request = new Request(
+ $vars,
+ $this->secureRandom,
+ $this->getMock('\OCP\Security\ICrypto'),
+ $this->config,
+ $this->stream
+ );
+
+ $this->assertEquals('POST', $request->method);
+ $result = $request->post;
+ // ensure there's no error attempting to decode the content
+ }
+
public function testPatch() {
global $data;
$data = http_build_query(array('name' => 'John Q. Public', 'nickname' => 'Joey'), '', '&');