Beispiel #1
0
 /**
  * Test Function for exceptionAction
  *
  * @return void
  */
 public function exceptionAction()
 {
     echo "In exception action\n";
     $view = new \Zend\View\PhpRenderer();
     $view->resolver()->addPath(dirname(__DIR__) . '/views');
     $view->render('ob.phtml');
 }
Beispiel #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\PhpRenderer();
        $view->resolver()->addPath($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);
    }