/** * @param [] $whiteIps * @param string $remoteIp * @param bool $isCurrentIp * @dataProvider isCurrentIpDataProvider */ public function testIsCurrentIp($whiteIps, $remoteIp, $isCurrentIp) { $this->remoteAddress->expects($this->atLeastOnce())->method('getRemoteAddress')->willReturn($remoteIp); $this->assertEquals($isCurrentIp, $this->request->isCurrentIp($whiteIps)); }
/** * @param bool $ipToLong * @dataProvider dataProviderBoolValues */ public function testGetRemoteIp($ipToLong) { $this->remoteAddressMock->expects($this->once())->method('getRemoteAddress')->will($this->returnValue($ipToLong)); $this->assertEquals($ipToLong, $this->helper->getRemoteIp($ipToLong)); }