]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - tests/HashTagDetectionTests.php
Merge activity plugin into mainline
[quix0rs-gnu-social.git] / tests / HashTagDetectionTests.php
index aeac4a5e3f6c932ac0e26a24b2c5610ed3999de1..47031d5bc41bae3ea77292a93cbd4e1755e7020b 100644 (file)
@@ -7,6 +7,7 @@ if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
 
 define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
 define('STATUSNET', true);
+define('LACONICA', true);
 
 require_once INSTALLDIR . '/lib/common.php';
 
@@ -41,6 +42,21 @@ class HashTagDetectionTests extends PHPUnit_Framework_TestCase
                            'say {#<span class="tag"><a href="' . common_local_url('tag', array('tag' => common_canonical_tag('hello'))) . '" rel="tag">hello</a></span>} people'),
                      array('say \'#hello\' people',
                            'say \'#<span class="tag"><a href="' . common_local_url('tag', array('tag' => common_canonical_tag('hello'))) . '" rel="tag">hello</a></span>\' people'),
+
+                     // Unicode legit letters
+                     array('#éclair yummy',
+                           '#<span class="tag"><a href="' . common_local_url('tag', array('tag' => common_canonical_tag('éclair'))) . '" rel="tag">éclair</a></span> yummy'),
+                     array('#维基百科 zh.wikipedia!',
+                           '#<span class="tag"><a href="' . common_local_url('tag', array('tag' => common_canonical_tag('维基百科'))) . '" rel="tag">维基百科</a></span> zh.wikipedia!'),
+                     array('#Россия russia',
+                           '#<span class="tag"><a href="' . common_local_url('tag', array('tag' => common_canonical_tag('Россия'))) . '" rel="tag">Россия</a></span> russia'),
+
+                     // Unicode punctuators -- the ideographic "," separates the tag, just as "," does
+                     array('#维基百科,zh.wikipedia!',
+                           '#<span class="tag"><a href="' . common_local_url('tag', array('tag' => common_canonical_tag('维基百科'))) . '" rel="tag">维基百科</a></span>,zh.wikipedia!'),
+                     array('#维基百科,zh.wikipedia!',
+                           '#<span class="tag"><a href="' . common_local_url('tag', array('tag' => common_canonical_tag('维基百科'))) . '" rel="tag">维基百科</a></span>,zh.wikipedia!'),
+
                      );
     }
 }