SimpleSAML\Test\Utils\HTTPTest::testGetSelfHost PHP Method

testGetSelfHost() public method

Test SimpleSAML\Utils\HTTP::getSelfHost() with and without custom port.
public testGetSelfHost ( )
    public function testGetSelfHost()
    {
        $original = $_SERVER;
        \SimpleSAML_Configuration::loadFromArray(array('baseurlpath' => ''), '[ARRAY]', 'simplesaml');
        $_SERVER['SERVER_PORT'] = '80';
        $this->assertEquals('localhost', HTTP::getSelfHost());
        $_SERVER['SERVER_PORT'] = '3030';
        $this->assertEquals('localhost', HTTP::getSelfHost());
        $_SERVER = $original;
    }