aboutsummaryrefslogtreecommitdiff
path: root/mod/thewire/tests
diff options
context:
space:
mode:
Diffstat (limited to 'mod/thewire/tests')
-rw-r--r--mod/thewire/tests/regex.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/mod/thewire/tests/regex.php b/mod/thewire/tests/regex.php
index a1a432a20..f5487a422 100644
--- a/mod/thewire/tests/regex.php
+++ b/mod/thewire/tests/regex.php
@@ -38,22 +38,46 @@ class TheWireRegexTest extends ElggCoreUnitTest {
parent::__destruct();
}
+ /**
+ * Get the link for a user's wire page
+ *
+ * @param string $username Username
+ * @return string
+ */
protected function getUserWireLink($username) {
$url = "thewire/owner/$username";
$url = elgg_normalize_url($url);
return "<a href=\"$url\">@$username</a>";
}
+ /**
+ * Get the link for a hashtag page
+ *
+ * @param string $tag Tag string
+ * @return string
+ */
protected function getHashtagLink($tag) {
$url = "thewire/tag/$tag";
$url = elgg_normalize_url($url);
return "<a href=\"$url\">#$tag</a>";
}
+ /**
+ * Get a link for an email address mailto
+ *
+ * @param string $address Email address
+ * @return string
+ */
protected function getEmailLink($address) {
return "<a href=\"mailto:$address\">$address</a>";
}
+ /**
+ * Get the html for a link
+ *
+ * @param string $address URL
+ * @return string
+ */
protected function getLink($address) {
return parse_urls($address);
}