Пример #1
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);
 }