Esempio n. 1
0
 /**
  * @return string
  */
 protected function _getUrl()
 {
     $refererUrl = $this->_request->getServer('HTTP_REFERER');
     $url = (string) $this->_request->getParam(self::PARAM_NAME_REFERER_URL);
     if ($url) {
         $refererUrl = $url;
     }
     $url = $this->_request->getParam(\Magento\Framework\App\Action\Action::PARAM_NAME_BASE64_URL);
     if ($url) {
         $refererUrl = $this->_urlCoder->decode($url);
     }
     $url = $this->_request->getParam(\Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED);
     if ($url) {
         $refererUrl = $this->_urlCoder->decode($url);
     }
     if (!$this->_isUrlInternal($refererUrl)) {
         $refererUrl = $this->_storeManager->getStore()->getBaseUrl();
     }
     return $refererUrl;
 }
Esempio n. 2
0
 public function testDecode()
 {
     $this->_urlMock->expects($this->once())->method('sessionUrlVar')->with($this->_url)->will($this->returnValue('expected'));
     $this->assertEquals('expected', $this->_urlCoder->decode($this->_encodeUrl));
 }