| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 24 | public function testIps( |
||
| 25 | string $remoteAddress, |
||
| 26 | array $headers, |
||
| 27 | array $trustedHosts, |
||
| 28 | ?array $ipHeaders, |
||
| 29 | $expectedUserIp |
||
| 30 | ) { |
||
| 31 | $request = new ServerRequest('GET', '/', $headers, null, '1.1', [ |
||
| 32 | 'REMOTE_ADDR' => $remoteAddress, |
||
| 33 | ]); |
||
| 34 | $nr = (new TrustedHostsNetworkResolver())->withServerRequest($request) |
||
| 35 | ->withNewTrustedHosts($trustedHosts, $ipHeaders); |
||
| 36 | $this->assertSame($expectedUserIp, $nr->getUserIp()); |
||
| 37 | } |
||
| 40 |