From b7e0078d1078c045c2f609d948905e73eb184add Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 29 Nov 2010 11:31:33 -0800 Subject: [PATCH] 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. --- tests/NicknameTest.php | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tests/NicknameTest.php 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'), + ); + } +}