/**
  * init method
  *
  * @return void
  */
 protected function _init()
 {
     $request = new CakeRequest('controller_posts/index');
     $response = new CakeResponse();
     $this->Controller = new RequestHandlerTestController($request, $response);
     $this->Controller->constructClasses();
     $this->RequestHandler = new RequestHandlerComponent($this->Controller->Components);
     $this->_extensions = Router::extensions();
 }
 /**
  * testDisabling method
  *
  * @access public
  * @return void
  */
 function testDisabling()
 {
     $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
     $this->_init();
     $this->Controller->Component->initialize($this->Controller);
     $this->Controller->beforeFilter();
     $this->Controller->Component->startup($this->Controller);
     $this->assertEqual($this->Controller->params, array('isAjax' => true));
     $this->Controller = new RequestHandlerTestDisabledController(array('components' => array('RequestHandler')));
     $this->Controller->constructClasses();
     $this->Controller->Component->initialize($this->Controller);
     $this->Controller->beforeFilter();
     $this->Controller->Component->startup($this->Controller);
     $this->assertEqual($this->Controller->params, array());
     unset($_SERVER['HTTP_X_REQUESTED_WITH']);
 }
 /**
  * init method
  *
  * @access protected
  * @return void
  */
 function _init()
 {
     $this->Controller = new RequestHandlerTestController(array('components' => array('RequestHandler')));
     $this->Controller->constructClasses();
     $this->RequestHandler =& $this->Controller->RequestHandler;
 }