X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2FHashTagDetectionTests.php;h=1fbc98983d66ab09a400b45990c9794103bf000f;hb=b53e1439969bfa2c0b551d8cc2fc8fe15652c62a;hp=4f0b31b0df054749c21e393300a989e924ce76bf;hpb=3400f6f431436552d3bef81a4b25733db2cdd9b6;p=quix0rs-gnu-social.git diff --git a/tests/HashTagDetectionTests.php b/tests/HashTagDetectionTests.php index 4f0b31b0df..1fbc98983d 100644 --- a/tests/HashTagDetectionTests.php +++ b/tests/HashTagDetectionTests.php @@ -6,7 +6,8 @@ if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) { } define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); -define('LACONICA', true); +define('GNUSOCIAL', true); +define('STATUSNET', true); // compatibility require_once INSTALLDIR . '/lib/common.php'; @@ -27,8 +28,35 @@ class HashTagDetectionTests extends PHPUnit_Framework_TestCase return array( array('hello', 'hello'), - array('#hello', - '#'), + array('#hello people', + '# people'), + array('"#hello" people', + '"#" people'), + array('say "#hello" people', + 'say "#" people'), + array('say (#hello) people', + 'say (#) people'), + array('say [#hello] people', + 'say [#] people'), + array('say {#hello} people', + 'say {#} people'), + array('say \'#hello\' people', + 'say \'#\' people'), + + // Unicode legit letters + array('#éclair yummy', + '# yummy'), + array('#维基百科 zh.wikipedia!', + '# zh.wikipedia!'), + array('#Россия russia', + '# russia'), + + // Unicode punctuators -- the ideographic "," separates the tag, just as "," does + array('#维基百科,zh.wikipedia!', + '#,zh.wikipedia!'), + array('#维基百科,zh.wikipedia!', + '#,zh.wikipedia!'), + ); } }