diff options
author | Steve Clay <steve@mrclay.org> | 2012-06-25 01:25:46 -0400 |
---|---|---|
committer | Steve Clay <steve@mrclay.org> | 2012-06-26 10:25:50 -0400 |
commit | 4fff20a33467a7318956412d4dabfcab1ce6daba (patch) | |
tree | b9b2a9d43c01e094cff258f9b4720a663123f0eb /engine/tests/regression/trac_bugs.php | |
parent | d71309056037adc869319566f9ec53313eb192d8 (diff) | |
download | elgg-4fff20a33467a7318956412d4dabfcab1ce6daba.tar.gz elgg-4fff20a33467a7318956412d4dabfcab1ce6daba.tar.bz2 |
Fixes #2276: Better friendly titles, portable ElggTranslit class, better units
Diffstat (limited to 'engine/tests/regression/trac_bugs.php')
-rw-r--r-- | engine/tests/regression/trac_bugs.php | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/engine/tests/regression/trac_bugs.php b/engine/tests/regression/trac_bugs.php index 26a45ab6a..e81bd6936 100644 --- a/engine/tests/regression/trac_bugs.php +++ b/engine/tests/regression/trac_bugs.php @@ -202,14 +202,25 @@ class ElggCoreRegressionBugsTest extends ElggCoreUnitTest { /** * http://trac.elgg.org/ticket/3210 - Don't remove -s in friendly titles - * @todo: http://trac.elgg.org/ticket/2276 - improve char encoding + * http://trac.elgg.org/ticket/2276 - improve char encoding */ public function test_friendly_title() { $cases = array( - 'Simple Test' => 'simple-test', - 'Test top-level page' => 'test-top-level-page', -// 'éclair' => 'éclair', -// 'English, Español, and 日本語' => 'english-español-and-日本語' + // hyphen, underscore and ASCII whitespace replaced by separator, + // other non-alphanumeric ASCII removed + "a-a_a a\na\ra\ta\va!a\"a#a\$a%a&a'a(a)a*a+a,a.a/a:a;a<a=a>a?a@a[a\\a]a^a`a{a|a}a~a" + => "a-a-a-a-a-a-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + + // separators trimmed + "-_ hello _-" => "hello", + + // accents removed, lower case, other multibyte chars are URL encoded + "I\xC3\xB1t\xC3\xABrn\xC3\xA2ti\xC3\xB4n\xC3\xA0liz\xC3\xA6ti\xC3\xB8n, AND \xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E" + // Iñtërnâtiônàlizætiøn, AND 日本語 + => 'internationalizaetion-and-%E6%97%A5%E6%9C%AC%E8%AA%9E', + + // some HTML entity replacements + "Me & You" => 'me-and-you', ); foreach ($cases as $case => $expected) { |