Adding tests for CakeRequest::addParams()

This commit is contained in:
Mark Story 2010-05-01 11:06:51 -04:00
parent 40bca71985
commit 0a7ba707b6

View file

@ -63,6 +63,21 @@ class CakeRequestTestCase extends CakeTestCase {
$this->assertEqual($request->query, array('one' => 'something', 'two' => 'else'));
}
/**
* test addParams() method
*
* @return void
*/
function testAddParams() {
$request = new CakeRequest('some/path');
$request->params = array('controller' => 'posts', 'action' => 'view');
$request->addParams(array('plugin' => null, 'action' => 'index'));
$this->assertEqual($request->controller, 'posts');
$this->assertEqual($request->action, 'index');
$this->assertEqual($request->plugin, null);
}
/**
* test parsing POST data into the object.
*