Exemple #1
0
 public function testGetHttpHeaderMethods()
 {
     $host = 'localhost';
     $this->assertEquals($host, $this->_header->getHttpHost());
     $this->assertEquals(false, $this->_header->getHttpUserAgent());
     $this->assertEquals(false, $this->_header->getHttpAcceptLanguage());
     $this->assertEquals(false, $this->_header->getHttpAcceptCharset());
     $this->assertEquals(false, $this->_header->getHttpReferer());
 }
Exemple #2
0
 /**
  * Initialize visitor information from server data
  *
  * @return $this
  */
 public function initServerData()
 {
     $clean = true;
     $this->addData(['server_addr' => $this->serverAddress->getServerAddress(true), 'remote_addr' => $this->remoteAddress->getRemoteAddress(true), 'http_secure' => $this->storeManager->getStore()->isCurrentlySecure(), 'http_host' => $this->httpHeader->getHttpHost($clean), 'http_user_agent' => $this->httpHeader->getHttpUserAgent($clean), 'http_accept_language' => $this->httpHeader->getHttpAcceptLanguage($clean), 'http_accept_charset' => $this->httpHeader->getHttpAcceptCharset($clean), 'request_uri' => $this->httpHeader->getRequestUri($clean), 'http_referer' => $this->httpHeader->getHttpReferer($clean)]);
     return $this;
 }