Happyr\LinkedIn\Http\UrlGeneratorTest::testGetCurrentURLPort8080 PHP Method

testGetCurrentURLPort8080() public method

    public function testGetCurrentURLPort8080()
    {
        $gen = $this->getMock('Happyr\\LinkedIn\\Http\\UrlGenerator', ['getHttpProtocol', 'getHttpHost', 'dropLinkedInParams'], []);
        $gen->expects($this->any())->method('getHttpProtocol')->will($this->returnValue('http'));
        $gen->expects($this->any())->method('getHttpHost')->will($this->returnValue('www.test.com:8080'));
        $gen->expects($this->any())->method('dropLinkedInParams')->will($this->returnCallback(function ($arg) {
            return empty($arg) ? '' : '?' . $arg;
        }));
        //test non default port 8080
        $_SERVER['REQUEST_URI'] = '/foobar.php';
        $this->assertEquals('http://www.test.com:8080/foobar.php', $gen->getCurrentUrl(), 'port 80 should not be shown');
    }