Beispiel #1
0
 protected function setUp()
 {
     $this->_originaltimezone = date_default_timezone_get();
     date_default_timezone_set('Europe/Berlin');
     if (isset($_SERVER['SERVER_NAME'])) {
         $this->_oldServer['SERVER_NAME'] = $_SERVER['SERVER_NAME'];
     }
     if (isset($_SERVER['SERVER_PORT'])) {
         $this->_oldServer['SERVER_PORT'] = $_SERVER['SERVER_PORT'];
     }
     if (isset($_SERVER['REQUEST_URI'])) {
         $this->_oldServer['REQUEST_URI'] = $_SERVER['REQUEST_URI'];
     }
     $_SERVER['SERVER_NAME'] = 'localhost';
     $_SERVER['SERVER_PORT'] = 80;
     $_SERVER['REQUEST_URI'] = '/';
     $this->_front = \Zend\Controller\Front::getInstance();
     $this->_oldRequest = $this->_front->getRequest();
     $this->_oldRouter = $this->_front->getRouter();
     $this->_front->resetInstance();
     $this->_front->setRequest(new Request\Http());
     $this->_front->getRouter()->addDefaultRoutes();
     parent::setUp();
     $this->_helper->setFormatOutput(true);
 }
Beispiel #2
0
 public function setUp()
 {
     parent::setUp();
     // doctype fix (someone forgot to clean up after their unit tests)
     $this->_doctypeHelper = $this->_helper->getView()->broker('doctype');
     $this->_oldDoctype = $this->_doctypeHelper->getDoctype();
     $this->_doctypeHelper->setDoctype(\Zend\View\Helper\Doctype::HTML4_LOOSE);
     // disable all active pages
     foreach ($this->_helper->findAllByActive(true) as $page) {
         $page->active = false;
     }
 }