public function testGetCurrentUrl() { $_SERVER = array('SERVER_PORT' => '80', 'SERVER_NAME' => 'localhost', 'REQUEST_URI' => '/abc.php'); $url = new Url(); $this->assertEquals('http://localhost/abc.php', $url->getCurrentUrl()); $_SERVER = array('HTTPS' => 'on', 'SERVER_PORT' => '8080', 'SERVER_NAME' => 'abc', 'REQUEST_URI' => '/'); $url = new Url(); $this->assertEquals('https://abc:8080/', $url->getCurrentUrl()); }