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

        parent::setUp();

        $this->_helper->setFormatOutput(true);
        $this->_helper->getView()->plugin('basepath')->setBasePath('');
    }
Esempio n. 3
0
 /**
  * @group ZF-8874
  */
 public function testRenderingWithoutWhitespace()
 {
     // Reset format output option
     $this->_helper->setFormatOutput(false);
     $expected = $this->_helper->render();
     $actual = $this->_getExpected('sitemap/without_whitespace.xml');
     $this->assertEquals($expected, $actual);
 }