summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-10-08 21:51:47 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-10-08 21:51:47 +0200
commit020bb33150ddaab4463b63799774f144a3448263 (patch)
tree3f38d2b1ed25ffa72899a1c4e4c33c3a5d56b12a /tests
parent3130438fcc5508ef7b8bd597f90d048e528d6760 (diff)
parentebe9bea709dd74e3cab3bbb8e9b1ea141bdf90bf (diff)
downloadnextcloud-server-020bb33150ddaab4463b63799774f144a3448263.tar.gz
nextcloud-server-020bb33150ddaab4463b63799774f144a3448263.zip
Merge pull request #19034 from owncloud/http-request-warning
Prevent 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 f75e4578546..bb9910b6a46 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->assertSame('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'), '', '&');