/** * Tests AddParamsToUrl. * @param string $url the URL to perform to add parameters to * @param string $params the parameters to add * @param string $expected the expected value of the final URL * @dataProvider AddParamsToUrlProvider */ public function testAddParamsToUrl($url, $params, $expected) { $value = UrlUtils::AddParamsToUrl($url, $params); $this->assertEquals($expected, $value); }
/** * Gets an endpoint using the given server and parameters. * @param string $endpoint the base endpoint URL to use * @param string $server the service to get the endpoint for * @param array $params the parameters to include in the endpoint * @return string the endpoint */ private function GetEndpoint($endpoint, $server = NULL, $params = NULL) { $endpoint = UrlUtils::AddParamsToUrl($endpoint, $params); if (!empty($server)) { $endpoint = UrlUtils::ReplaceServerInUrl($endpoint, $server); } return $endpoint; }
/** * Gets an endpoint using the given server and parameters. * @param string $endpoint the base endpoint URL to use * @param array $params the parameters to include in the endpoint * @return string the endpoint */ private function GetEndpoint($endpoint, $params = null) { $endpoint = UrlUtils::AddParamsToUrl($endpoint, $params); if (!empty($this->server)) { $endpoint = UrlUtils::ReplaceServerInUrl($endpoint, $this->server); } return $endpoint; }
/** * Gets an endpoint using the given server and parameters. * @param string $endpoint the base endpoint URL to use * @param array $params the parameters to include in the endpoint * @return string the endpoint */ private function GetEndpoint($endpoint, $params = null) { return UrlUtils::AddParamsToUrl($endpoint, $params); }