summaryrefslogtreecommitdiff
path: root/tests/TestBaseApi.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-05-12 19:25:03 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-05-12 19:25:03 +0200
commit88d7b9631b444cef28115fb8e0bae736b45e557e (patch)
tree9c676c98dbface055c68df2731f3a7482dae465b /tests/TestBaseApi.php
parentfc093a5fe51d35a2991e549e8836cac15dc2888b (diff)
parentb57c8d4581b05cd70a363cacd37f9ffc7da785d8 (diff)
downloadsemanticscuttle-88d7b9631b444cef28115fb8e0bae736b45e557e.tar.gz
semanticscuttle-88d7b9631b444cef28115fb8e0bae736b45e557e.tar.bz2
Merge branch 'master' into configurable-privacy2
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 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