Added unit test for CakeRequest::setInput

Don't use mocks as the tests weren't really testing anything when mocks
were involved.

Refs #3764
This commit is contained in:
Derek Perkins 2014-06-21 10:28:10 -06:00 committed by mark_story
parent 6bf0b22195
commit b1a3ab9e64

View file

@ -2081,7 +2081,7 @@ class CakeRequestTest extends CakeTestCase {
/**
* Data provider for testing reading values with CakeRequest::param()
*
*
* @return array
*/
public function paramReadingDataProvider() {
@ -2218,6 +2218,22 @@ class CakeRequestTest extends CakeTestCase {
$this->assertEquals('/posts/base_path/1/name:value?test=value', $result);
}
/**
* Test the input() method.
*
* @return void
*/
public function testSetInput() {
$request = new CakeRequest('/');
$request->setInput('I came from setInput');
$result = $request->input();
$this->assertEquals('I came from setInput', $result);
$result = $request->input();
$this->assertEquals('I came from setInput', $result);
}
/**
* Test the input() method.
*