Esempio n. 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'] = '/';

        parent::setUp();

        $this->_helper->setFormatOutput(true);
        $this->_helper->getView()->plugin('basepath')->setBasePath('');
    }
Esempio n. 2
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);
 }
Esempio n. 3
0
 public function setUp()
 {
     parent::setUp();
     // doctype fix (someone forgot to clean up after their unit tests)
     $this->_doctypeHelper = $this->_helper->getView()->plugin('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;
     }
 }
Esempio n. 4
0
 /**
  * Returns the contens of the expected $file, normalizes newlines
  * @param  string $file
  * @return string
  */
 protected function _getExpected($file)
 {
     return str_replace("\n", PHP_EOL, parent::_getExpected($file));
 }