PhlyTest\Http\ServerRequestFactoryTest::testMarshalHostAndPortReturnsServerAddrForHostIfPresentAndHostIsIpv6Address PHP Method

testMarshalHostAndPortReturnsServerAddrForHostIfPresentAndHostIsIpv6Address() public method

    public function testMarshalHostAndPortReturnsServerAddrForHostIfPresentAndHostIsIpv6Address()
    {
        $request = new ServerRequest();
        $request = $request->withUri(new Uri());
        $server = ['SERVER_ADDR' => 'FE80::0202:B3FF:FE1E:8329', 'SERVER_NAME' => '[FE80::0202:B3FF:FE1E:8329]', 'SERVER_PORT' => 8000];
        $accumulator = (object) ['host' => '', 'port' => null];
        ServerRequestFactory::marshalHostAndPort($accumulator, $server, $request);
        $this->assertEquals('[FE80::0202:B3FF:FE1E:8329]', $accumulator->host);
        $this->assertEquals(8000, $accumulator->port);
    }
ServerRequestFactoryTest