public function testGetCurrentURL() { $client = new Client(array('client_id' => self::CLIENT_ID, 'client_secret' => self::CLIENT_SECRET)); $_SERVER['HTTP_HOST'] = 'www.test.com'; $_SERVER['REQUEST_URI'] = '/unit-tests.php?one=one&two=two&three=three'; $current_url = $client->get_current_url(); $this->assertEquals('http://www.test.com/unit-tests.php?one=one&two=two&three=three', $current_url, 'getCurrentUrl function is changing the current URL'); $_SERVER['HTTP_HOST'] = 'www.test.com'; $_SERVER['REQUEST_URI'] = '/unit-tests.php?one=&two=&three='; $current_url = $client->get_current_url(); $this->assertEquals('http://www.test.com/unit-tests.php?one=&two=&three=', $current_url, 'getCurrentUrl function is changing the current URL'); $_SERVER['HTTP_HOST'] = 'www.test.com'; $_SERVER['REQUEST_URI'] = '/unit-tests.php?one&two&three'; $current_url = $client->get_current_url(); $this->assertEquals('http://www.test.com/unit-tests.php?one&two&three', $current_url, 'getCurrentUrl function is changing the current URL'); }