PhlyTest\Http\ServerRequestFactoryTest::testMarshalHostAndPortReturnsServerPortForPortWhenPresentWithServerName PHP Method

testMarshalHostAndPortReturnsServerPortForPortWhenPresentWithServerName() public method

    public function testMarshalHostAndPortReturnsServerPortForPortWhenPresentWithServerName()
    {
        $request = new ServerRequest();
        $request = $request->withUri(new Uri());
        $server = ['SERVER_NAME' => 'example.com', 'SERVER_PORT' => 8000];
        $accumulator = (object) ['host' => '', 'port' => null];
        ServerRequestFactory::marshalHostAndPort($accumulator, $server, $request);
        $this->assertEquals('example.com', $accumulator->host);
        $this->assertEquals(8000, $accumulator->port);
    }
ServerRequestFactoryTest