remove settings parameter from initialize as this is not being passed. only the constructor gets settings passed

This commit is contained in:
Ceeram 2012-08-27 11:22:06 +02:00
parent 934838f77c
commit f1ce3f9ae5
2 changed files with 5 additions and 7 deletions

View file

@ -123,11 +123,10 @@ class RequestHandlerComponent extends Component {
* and the requested mime-types, RequestHandler::$ext is set to that value. * and the requested mime-types, RequestHandler::$ext is set to that value.
* *
* @param Controller $controller A reference to the controller * @param Controller $controller A reference to the controller
* @param array $settings Array of settings to _set().
* @return void * @return void
* @see Router::parseExtensions() * @see Router::parseExtensions()
*/ */
public function initialize(Controller $controller, $settings = array()) { public function initialize(Controller $controller) {
if (isset($this->request->params['ext'])) { if (isset($this->request->params['ext'])) {
$this->ext = $this->request->params['ext']; $this->ext = $this->request->params['ext'];
} }
@ -135,9 +134,8 @@ class RequestHandlerComponent extends Component {
$this->_setExtension(); $this->_setExtension();
} }
$this->params = $controller->params; $this->params = $controller->params;
$this->_set($settings); if (!empty($this->settings['viewClassMap'])) {
if (!empty($settings['viewClassMap'])) { $this->viewClassMap($this->settings['viewClassMap']);
$this->viewClassMap($settings['viewClassMap']);
} }
} }

View file

@ -281,8 +281,8 @@ class RequestHandlerComponentTest extends CakeTestCase {
* @return void * @return void
*/ */
public function testViewClassMap() { public function testViewClassMap() {
$settings = array('viewClassMap' => array('json' => 'CustomJson')); $this->RequestHandler->settings = array('viewClassMap' => array('json' => 'CustomJson'));
$this->RequestHandler->initialize($this->Controller, $settings); $this->RequestHandler->initialize($this->Controller);
$result = $this->RequestHandler->viewClassMap(); $result = $this->RequestHandler->viewClassMap();
$expected = array( $expected = array(
'json' => 'CustomJson', 'json' => 'CustomJson',