Skip to content
This repository
Browse code

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 authored August 27, 2012
8  lib/Cake/Controller/Component/RequestHandlerComponent.php
@@ -123,11 +123,10 @@ public function __construct(ComponentCollection $collection, $settings = array()
123 123
  * and the requested mime-types, RequestHandler::$ext is set to that value.
124 124
  *
125 125
  * @param Controller $controller A reference to the controller
126  
- * @param array $settings Array of settings to _set().
127 126
  * @return void
128 127
  * @see Router::parseExtensions()
129 128
  */
130  
-	public function initialize(Controller $controller, $settings = array()) {
  129
+	public function initialize(Controller $controller) {
131 130
 		if (isset($this->request->params['ext'])) {
132 131
 			$this->ext = $this->request->params['ext'];
133 132
 		}
@@ -135,9 +134,8 @@ public function initialize(Controller $controller, $settings = array()) {
135 134
 			$this->_setExtension();
136 135
 		}
137 136
 		$this->params = $controller->params;
138  
-		$this->_set($settings);
139  
-		if (!empty($settings['viewClassMap'])) {
140  
-			$this->viewClassMap($settings['viewClassMap']);
  137
+		if (!empty($this->settings['viewClassMap'])) {
  138
+			$this->viewClassMap($this->settings['viewClassMap']);
141 139
 		}
142 140
 	}
143 141
 
4  lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php
@@ -281,8 +281,8 @@ public function testInitializeContentTypeAndExtensionMismatch() {
281 281
  * @return void
282 282
  */
283 283
 	public function testViewClassMap() {
284  
-		$settings = array('viewClassMap' => array('json' => 'CustomJson'));
285  
-		$this->RequestHandler->initialize($this->Controller, $settings);
  284
+		$this->RequestHandler->settings = array('viewClassMap' => array('json' => 'CustomJson'));
  285
+		$this->RequestHandler->initialize($this->Controller);
286 286
 		$result = $this->RequestHandler->viewClassMap();
287 287
 		$expected = array(
288 288
 			'json' => 'CustomJson',

0 notes on commit f1ce3f9

Please sign in to comment.
Something went wrong with that request. Please try again.