mirror of
https://github.com/nextcloud/server.git
synced 2026-03-23 19:03:20 -04:00
Unit test for preventing warning decoding content
This commit is contained in:
parent
0b0daa8351
commit
ebe9bea709
1 changed files with 21 additions and 0 deletions
|
|
@ -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'), '', '&');
|
||||
|
|
|
|||
Loading…
Reference in a new issue