aboutsummaryrefslogtreecommitdiffstats
path: root/tests/get_tags_test.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-04-07 02:11:56 -0700
committerfriendica <info@friendica.com>2012-04-07 02:11:56 -0700
commitcf2d8ef7a6ebbaefd0210396eeaa6686480a02ac (patch)
tree9b1f7ba17dcb24dd3e254956b22e31fa29a0ca15 /tests/get_tags_test.php
parentf30146b521bf079e2651484e0e63f9596d6a3dd6 (diff)
downloadvolse-hubzilla-cf2d8ef7a6ebbaefd0210396eeaa6686480a02ac.tar.gz
volse-hubzilla-cf2d8ef7a6ebbaefd0210396eeaa6686480a02ac.tar.bz2
volse-hubzilla-cf2d8ef7a6ebbaefd0210396eeaa6686480a02ac.zip
tag tests cont.
Diffstat (limited to 'tests/get_tags_test.php')
-rw-r--r--tests/get_tags_test.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/get_tags_test.php b/tests/get_tags_test.php
index 3e370c545..68b43231b 100644
--- a/tests/get_tags_test.php
+++ b/tests/get_tags_test.php
@@ -139,9 +139,19 @@ class GetTagsTest extends PHPUnit_Framework_TestCase {
$str_tags='';
handle_tag($this->a, $text, $inform, $str_tags, 11, $tags[0]);
- $this->assertEquals("cid:15", $inform);
- $this->assertEquals("@[url=http://justatest.de]Mike Lastname[/url]", $str_tags);
- $this->assertEquals("hi @[url=http://justatest.de]Mike Lastname[/url].because", $text);
+ // (mike) - This is a tricky case.
+ // we support mentions as in @mike@example.com - which contains a period.
+ // This shouldn't match anything unless you have a contact named "Mike.because".
+ // We may need another test for "@Mike. because" - which should return the contact
+ // as we ignore trailing periods in tags.
+
+// $this->assertEquals("cid:15", $inform);
+// $this->assertEquals("@[url=http://justatest.de]Mike Lastname[/url]", $str_tags);
+// $this->assertEquals("hi @[url=http://justatest.de]Mike Lastname[/url].because", $text);
+
+ $this->assertEquals("", $inform);
+ $this->assertEquals("", $str_tags);
+
}
/**
@@ -253,7 +263,8 @@ class GetTagsTest extends PHPUnit_Framework_TestCase {
$this->assertEquals("Test with @[url=http://justatest.de]Mike Lastname[/url] id tag", $text);
$this->assertEquals("@[url=http://justatest.de]Mike Lastname[/url]", $str_tags);
- $this->assertEquals("cid:15", $inform);
+ // this test may produce two cid:15 entries - which is OK because duplicates are pruned before delivery
+ $this->assertTrue(strstr($inform,"cid:15"));
}
/**