/** * @dataProvider getServerAddressProvider */ public function testGetServerAddress($serverVar, $expected, $ipToLong) { $this->_request->expects($this->atLeastOnce())->method('getServer')->with('SERVER_ADDR')->will($this->returnValue($serverVar)); $this->assertEquals($expected, $this->_serverAddress->getServerAddress($ipToLong)); }
public function testGetServerAddress() { $this->assertEquals(false, $this->_helper->getServerAddress()); }
/** * 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; }