Skip to content
This repository
Browse code

Fixing regression in ControllerTestCase after changes done in Request…

…HandlerComponent
  • Loading branch information...
commit 3fc6d293fcd4f2584bfb63aee99e18c5beb1f757 1 parent 358d5c2
José Lorenzo Rodríguez authored November 01, 2011

Showing 1 changed file with 9 additions and 0 deletions. Show diff stats Hide diff stats

  1. 9  lib/Cake/TestSuite/ControllerTestCase.php
9  lib/Cake/TestSuite/ControllerTestCase.php
@@ -59,6 +59,15 @@ function _getController($request, $response) {
59 59
 		$this->testController->helpers = array_merge(array('InterceptContent'), $this->testController->helpers);
60 60
 		$this->testController->setRequest($request);
61 61
 		$this->testController->response = $this->response;
  62
+		foreach ($this->testController->Components->attached() as $component) {
  63
+			$object = $this->testController->Components->{$component};
  64
+			if (isset($object->response)) {
  65
+				$object->response = $response;
  66
+			}
  67
+		}
  68
+		if (isset($object->request)) {
  69
+			$object->request = $request;
  70
+		}
62 71
 		return $this->testController;
63 72
 	}
64 73
 

0 notes on commit 3fc6d29

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