Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove settings parameter from initialize as this is not being passed…

…. only the constructor gets settings passed
  • Loading branch information...
commit f1ce3f9ae55479c3a7c87a6a869624c67681f488 1 parent 934838f
@ceeram ceeram authored
View
8 lib/Cake/Controller/Component/RequestHandlerComponent.php
@@ -123,11 +123,10 @@ public function __construct(ComponentCollection $collection, $settings = array()
* and the requested mime-types, RequestHandler::$ext is set to that value.
*
* @param Controller $controller A reference to the controller
- * @param array $settings Array of settings to _set().
* @return void
* @see Router::parseExtensions()
*/
- public function initialize(Controller $controller, $settings = array()) {
+ public function initialize(Controller $controller) {
if (isset($this->request->params['ext'])) {
$this->ext = $this->request->params['ext'];
}
@@ -135,9 +134,8 @@ public function initialize(Controller $controller, $settings = array()) {
$this->_setExtension();
}
$this->params = $controller->params;
- $this->_set($settings);
- if (!empty($settings['viewClassMap'])) {
- $this->viewClassMap($settings['viewClassMap']);
+ if (!empty($this->settings['viewClassMap'])) {
+ $this->viewClassMap($this->settings['viewClassMap']);
}
}
View
4 lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php
@@ -281,8 +281,8 @@ public function testInitializeContentTypeAndExtensionMismatch() {
* @return void
*/
public function testViewClassMap() {
- $settings = array('viewClassMap' => array('json' => 'CustomJson'));
- $this->RequestHandler->initialize($this->Controller, $settings);
+ $this->RequestHandler->settings = array('viewClassMap' => array('json' => 'CustomJson'));
+ $this->RequestHandler->initialize($this->Controller);
$result = $this->RequestHandler->viewClassMap();
$expected = array(
'json' => 'CustomJson',
Please sign in to comment.
Something went wrong with that request. Please try again.