summaryrefslogtreecommitdiff
path: root/tests/TestBaseApi.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-05-12 19:24:34 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-05-12 19:24:34 +0200
commitfbfbd8d5cae579058b5d31b97c062cefd9bb36b6 (patch)
tree55b52f5094d73e199db55dc955273c9e2403a6cb /tests/TestBaseApi.php
parent0901501fc741cec51a8060321ea0eb25d3859e1a (diff)
parentb57c8d4581b05cd70a363cacd37f9ffc7da785d8 (diff)
downloadsemanticscuttle-fbfbd8d5cae579058b5d31b97c062cefd9bb36b6.tar.gz
semanticscuttle-fbfbd8d5cae579058b5d31b97c062cefd9bb36b6.tar.bz2
Merge branch 'master' into ssl-client-certs
Diffstat (limited to 'tests/TestBaseApi.php')
-rw-r--r--tests/TestBaseApi.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/TestBaseApi.php b/tests/TestBaseApi.php
index 8ed41cd..036ab6b 100644
--- a/tests/TestBaseApi.php
+++ b/tests/TestBaseApi.php
@@ -92,6 +92,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 request object and prepares