diff options
Diffstat (limited to 'tests/TestBaseApi.php')
-rw-r--r-- | tests/TestBaseApi.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/TestBaseApi.php b/tests/TestBaseApi.php index 23e1812..2caa701 100644 --- a/tests/TestBaseApi.php +++ b/tests/TestBaseApi.php @@ -85,6 +85,23 @@ class TestBaseApi extends TestBase } + /** + * Completes an URL that's missing the protocol. + * Useful when re-using URLs extracted from HTML + * + * @param string $url Potentially partial URL + * + * @return string Full URL + */ + protected function completeUrl($url) + { + if (substr($url, 0, 2) == '//') { + $url = 'http:' . $url; + } + return $url; + } + + /** * Creates a user and a HTTP GET request object and prepares |