summaryrefslogtreecommitdiff
path: root/tests/TestBaseApi.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-05-12 19:09:30 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-05-12 19:09:30 +0200
commitaea9c9ddbb1c0fd51192ebdcb1d1dfa258298e8c (patch)
tree78ec00d1b269027bf58c7aa1a9f66a833aa5a0d5 /tests/TestBaseApi.php
parentf647c4847783101edd32d48eeec3131fe2e48bd8 (diff)
downloadsemanticscuttle-aea9c9ddbb1c0fd51192ebdcb1d1dfa258298e8c.tar.gz
semanticscuttle-aea9c9ddbb1c0fd51192ebdcb1d1dfa258298e8c.tar.bz2
fix a test that failed when using a base URL without protocol
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