Esempio n. 1
0
 public function setUp()
 {
     $view = new \Zend\View\View();
     $base = str_replace('/', DIRECTORY_SEPARATOR, '/../_templates');
     $view->setScriptPath(__DIR__ . $base);
     $view->strictVars(true);
     $this->view = $view;
 }
Esempio n. 2
0
 /**
  * Prepares the environment before running a test
  *
  */
 protected function setUp()
 {
     $cwd = __DIR__;
     // read navigation config
     $this->_files = $cwd . '/_files';
     $config = new \Zend\Config\Xml($this->_files . '/navigation.xml');
     // setup containers from config
     $this->_nav1 = new Navigation\Navigation($config->get('nav_test1'));
     $this->_nav2 = new Navigation\Navigation($config->get('nav_test2'));
     // setup view
     $view = new \Zend\View\View();
     $view->setScriptPath($cwd . '/_files/mvc/views');
     // setup front
     $front = Controller\Front::getInstance();
     $this->_oldControllerDir = $front->getControllerDirectory('test');
     $front->setControllerDirectory($cwd . '/_files/mvc/controllers');
     // create helper
     $this->_helper = new $this->_helperName();
     $this->_helper->setView($view);
     // set nav1 in helper as default
     $this->_helper->setContainer($this->_nav1);
 }