PhlyTest\Http\ServerRequestFactoryTest::testMarshalHostAndPortWillDetectPortInIpv6StyleHost PHP Method

testMarshalHostAndPortWillDetectPortInIpv6StyleHost() public method

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