ソースを参照

Fixing regression in ControllerTestCase after changes done in RequestHandlerComponent

Jose Lorenzo Rodriguez 14 年 前
コミット
3fc6d293fc
1 ファイル変更9 行追加0 行削除
  1. 9 0
      lib/Cake/TestSuite/ControllerTestCase.php

+ 9 - 0
lib/Cake/TestSuite/ControllerTestCase.php

@@ -59,6 +59,15 @@ class ControllerTestDispatcher extends Dispatcher {
 		$this->testController->helpers = array_merge(array('InterceptContent'), $this->testController->helpers);
 		$this->testController->setRequest($request);
 		$this->testController->response = $this->response;
+		foreach ($this->testController->Components->attached() as $component) {
+			$object = $this->testController->Components->{$component};
+			if (isset($object->response)) {
+				$object->response = $response;
+			}
+		}
+		if (isset($object->request)) {
+			$object->request = $request;
+		}
 		return $this->testController;
 	}