setRequest() public method

- $this->request - To the $request parameter - $this->plugin - To the $request->params['plugin'] - $this->passedArgs - Same as $request->params['pass] - View::$plugin - $this->plugin
public setRequest ( Cake\Network\Request $request ) : void
$request Cake\Network\Request Request instance.
return void
Ejemplo n.º 1
0
 /**
  * Returns the test controller
  *
  * @param \Cake\Network\Request $request Request object
  * @param \Cake\Network\Response $response Response for the controller.
  * @return \Cake\Controller\Controller
  */
 protected function _getController($request, $response)
 {
     if ($this->testController === null) {
         $this->testController = parent::_getController($request, $response);
     }
     $default = array('InterceptContent' => array('className' => 'Cake\\TestSuite\\InterceptContentHelper'));
     $this->testController->helpers = array_merge($default, $this->testController->helpers);
     $this->testController->setRequest($request);
     $this->testController->response = $this->response;
     $registry = $this->testController->components();
     foreach ($registry->loaded() as $component) {
         $object = $registry->{$component};
         if (isset($object->response)) {
             $object->response = $response;
         }
         if (isset($object->request)) {
             $object->request = $request;
         }
     }
     return $this->testController;
 }