Test to prove issue with empty body for json

This commit is contained in:
Mark van Driel 2019-08-19 14:52:46 +02:00
parent 31dbda0a71
commit d4c351563e

View file

@ -399,6 +399,20 @@ class RequestHandlerComponentTest extends CakeTestCase {
$this->assertFalse(is_object($this->Controller->data));
}
/**
* testStartupCallbackJson method
*
* @return void
*/
public function testStartupCallbackJson() {
$_SERVER['REQUEST_METHOD'] = 'PUT';
$_SERVER['CONTENT_TYPE'] = 'application/json';
$this->Controller->request = $this->getMock('CakeRequest', array('_readInput'));
$this->RequestHandler->startup($this->Controller);
$this->assertTrue(is_array($this->Controller->data));
$this->assertFalse(is_object($this->Controller->data));
}
/**
* testStartupCallback with charset.
*