From: Brion Vibber Date: Mon, 29 Nov 2010 19:31:33 +0000 (-0800) Subject: Start on some nickname-validation test cases: several of these fail right now because... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b7e0078d1078c045c2f609d948905e73eb184add;p=quix0rs-gnu-social.git Start on some nickname-validation test cases: several of these fail right now because we had regressions in 0.8 or 0.9 where we lost normalization of uppercase and some other chars. --- diff --git a/tests/NicknameTest.php b/tests/NicknameTest.php new file mode 100644 index 0000000000..95af94098d --- /dev/null +++ b/tests/NicknameTest.php @@ -0,0 +1,52 @@ +assertEquals($expected, $norm, "normalized input nickname: $input -> $norm"); + } else { + $this->assertEquals($expected, false, "invalid input nickname: $input"); + } + } + + static public function provider() + { + return array( + array('evan', 'evan'), + array('Evan', 'evan'), + array('EVAN', 'evan'), + array('ev_an', 'evan'), + array('ev.an', 'evan'), + array('ev/an', false), + array('ev an', false), + array('ev-an', false), + array('évan', false), // so far... + array('Évan', false), // so far... + array('evan1', 'evan1'), + array('evan_1', 'evan1'), + ); + } +}