diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php index 89f830f8520..87249331611 100644 --- a/lib/Cake/Network/CakeRequest.php +++ b/lib/Cake/Network/CakeRequest.php @@ -733,7 +733,7 @@ public function data($name) { * @return The decoded/processed request data. */ public function input($callback = null) { - $input = $this->_readStdin(); + $input = $this->_readInput(); $args = func_get_args(); if (!empty($args)) { $callback = array_shift($args); @@ -746,9 +746,9 @@ public function input($callback = null) { /** * Read data from php://input, mocked in tests. * - * @return string contents of stdin + * @return string contents of php://input */ - protected function _readStdin() { + protected function _readInput() { if (empty($this->_input)) { $fh = fopen('php://input', 'r'); $content = stream_get_contents($fh); diff --git a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php index f6ff3eb941d..1d0303785d3 100644 --- a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php @@ -256,7 +256,7 @@ public function testAutoAjaxLayout() { public function testStartupCallback() { $_SERVER['REQUEST_METHOD'] = 'PUT'; $_SERVER['CONTENT_TYPE'] = 'application/xml'; - $this->Controller->request = $this->getMock('CakeRequest', array('_readStdin')); + $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)); @@ -270,7 +270,7 @@ public function testStartupCallback() { public function testStartupCallbackCharset() { $_SERVER['REQUEST_METHOD'] = 'PUT'; $_SERVER['CONTENT_TYPE'] = 'application/xml; charset=UTF-8'; - $this->Controller->request = $this->getMock('CakeRequest', array('_readStdin')); + $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)); @@ -287,9 +287,9 @@ public function testStartupCustomTypeProcess() { } $_SERVER['REQUEST_METHOD'] = 'POST'; $_SERVER['CONTENT_TYPE'] = 'text/csv'; - $this->Controller->request = $this->getMock('CakeRequest', array('_readStdin')); + $this->Controller->request = $this->getMock('CakeRequest', array('_readInput')); $this->Controller->request->expects($this->once()) - ->method('_readStdin') + ->method('_readInput') ->will($this->returnValue('"A","csv","string"')); $this->RequestHandler->addInputType('csv', array('str_getcsv')); $this->RequestHandler->startup($this->Controller); diff --git a/lib/Cake/Test/Case/Network/CakeRequestTest.php b/lib/Cake/Test/Case/Network/CakeRequestTest.php index 05c07601b92..acd0ba2a23f 100644 --- a/lib/Cake/Test/Case/Network/CakeRequestTest.php +++ b/lib/Cake/Test/Case/Network/CakeRequestTest.php @@ -1518,8 +1518,8 @@ public function testHere() { * @return void */ public function testInput() { - $request = $this->getMock('CakeRequest', array('_readStdin')); - $request->expects($this->once())->method('_readStdin') + $request = $this->getMock('CakeRequest', array('_readInput')); + $request->expects($this->once())->method('_readInput') ->will($this->returnValue('I came from stdin')); $result = $request->input(); @@ -1532,8 +1532,8 @@ public function testInput() { * @return void */ public function testInputDecode() { - $request = $this->getMock('CakeRequest', array('_readStdin')); - $request->expects($this->once())->method('_readStdin') + $request = $this->getMock('CakeRequest', array('_readInput')); + $request->expects($this->once())->method('_readInput') ->will($this->returnValue('{"name":"value"}')); $result = $request->input('json_decode'); @@ -1553,8 +1553,8 @@ public function testInputDecodeExtraParams() { XML; - $request = $this->getMock('CakeRequest', array('_readStdin')); - $request->expects($this->once())->method('_readStdin') + $request = $this->getMock('CakeRequest', array('_readInput')); + $request->expects($this->once())->method('_readInput') ->will($this->returnValue($xml)); $result = $request->input('Xml::build', array('return' => 'domdocument'));