Example #1
0
 /**
  * @param $serverVariables array
  * @param $expectedResult string
  * @dataProvider serverVariablesProvider
  */
 public function testGetDistroBaseUrl($serverVariables, $expectedResult)
 {
     $originalServerValue = $_SERVER;
     $_SERVER = $serverVariables;
     $this->_model = $this->getModel();
     $this->assertEquals($expectedResult, $this->_model->getDistroBaseUrl());
     $_SERVER = $originalServerValue;
 }
Example #2
0
 /**
  * Handler for session errors
  *
  * @param \Exception $exception
  * @return bool
  */
 private function handleSessionException(\Exception $exception)
 {
     if ($exception instanceof \Magento\Framework\Exception\SessionException) {
         $this->_response->setRedirect($this->_request->getDistroBaseUrl());
         $this->_response->sendHeaders();
         return true;
     }
     return false;
 }