Example #1
0
	/**
	 * start
	 *
	 * @access public
	 * @return void
	 */
	function start() {
		$this->Controller = new CookieComponentTestController();
		$this->Controller->constructClasses();
		$this->Controller->Component->initialize($this->Controller);
		$this->Controller->beforeFilter();
		$this->Controller->Component->startup($this->Controller);
		$this->Controller->Cookie->destroy();
	}
 /**
  * start
  *
  * @return void
  */
 public function setUp()
 {
     $_COOKIE = array();
     $this->Controller = new RememberMeComponentTestController(new CakeRequest(), new CakeResponse());
     $this->Controller->constructClasses();
     $this->RememberMe = $this->Controller->RememberMe;
     $this->RememberMe->Cookie = $this->getMock('CookieComponent', array(), array($this->Controller->Components));
     $this->RememberMe->Auth = $this->getMock('AuthComponent', array(), array($this->Controller->Components));
 }
Example #3
0
 /**
  * start
  *
  * @return void
  */
 public function setUp()
 {
     $_COOKIE = array();
     Configure::write('Config.language', 'eng');
     $this->request = new CakeRequest();
     $this->Controller = new RememberMeComponentTestController($this->request, new CakeResponse());
     $this->Controller->constructClasses();
     $this->RememberMe = $this->Controller->RememberMe;
     $this->RememberMe->Cookie = $this->getMock('CookieComponent', array(), array($this->Controller->Components));
     $this->RememberMe->Auth = $this->getMock('AuthComponent', array(), array($this->Controller->Components));
     $this->RememberMe->request = $this->request;
 }
Example #4
0
 /**
  * start
  *
  * @return void
  */
 public function setUp()
 {
     $_COOKIE = array();
     $this->Controller = new CookieComponentTestController(new CakeRequest(), new CakeResponse());
     $this->Controller->constructClasses();
     $this->Cookie = $this->Controller->Cookie;
     $this->Cookie->name = 'CakeTestCookie';
     $this->Cookie->time = 10;
     $this->Cookie->path = '/';
     $this->Cookie->domain = '';
     $this->Cookie->secure = false;
     $this->Cookie->key = 'somerandomhaskey';
     $this->Cookie->startup($this->Controller);
 }
Example #5
0
 function testSetTheme()
 {
     $this->Controller->params['prefix'] = 'admin';
     $this->Controller->params['controller'] = 'widgets';
     $this->controller->params = array('url' => array('url' => '/admin/widgets/index'));
     $this->Controller->action = 'index';
     $this->_init();
     $this->Controller->layout = false;
     $this->Controller->render(false);
     $expected = 'admin';
     $result = $this->Controller->theme;
     $this->assertEqual($result, $expected);
     $this->Controller->params['prefix'] = null;
     $this->Controller->params['controller'] = 'widgets';
     $this->Controller->params = array('url' => array('url' => '/widgets/index'));
     $this->Controller->action = 'index';
     $this->_init();
     $this->Controller->index();
     $this->Controller->layout = false;
     $this->Controller->render(false);
     $expected = 'en-gb';
     $result = $this->Controller->theme;
     $this->assertEqual($result, $expected);
 }