diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-09-24 12:25:57 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-09-24 12:25:57 +0200 |
commit | f3fef8934ee1614bc158c05699e57f0ba8a3fcb6 (patch) | |
tree | dc0f45799152565dcb5bb1b399118c46888e5746 /tests | |
parent | 43279ee0103c7d26e1755ccdd353d6af2f38491b (diff) | |
parent | c20b658f708f7ec65b845d554f579adb874d179f (diff) | |
download | forums-f3fef8934ee1614bc158c05699e57f0ba8a3fcb6.tar forums-f3fef8934ee1614bc158c05699e57f0ba8a3fcb6.tar.gz forums-f3fef8934ee1614bc158c05699e57f0ba8a3fcb6.tar.bz2 forums-f3fef8934ee1614bc158c05699e57f0ba8a3fcb6.tar.xz forums-f3fef8934ee1614bc158c05699e57f0ba8a3fcb6.zip |
Merge pull request #2954 from rxu/ticket/13055
[ticket/13055] Fix string profile fields validation to support unicode
Diffstat (limited to 'tests')
-rw-r--r-- | tests/profilefields/type_string_test.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/profilefields/type_string_test.php b/tests/profilefields/type_string_test.php index d5384e0ae8..a7be087fb5 100644 --- a/tests/profilefields/type_string_test.php +++ b/tests/profilefields/type_string_test.php @@ -167,6 +167,55 @@ class phpbb_profilefield_type_string_test extends phpbb_test_case 'FIELD_INVALID_CHARS_ALPHA_PUNCTUATION-field', 'Required field should reject field having invalid input for the given validation', ), + // UTF-8 string tests + array( + 'ö äö äö ä', + array('field_validation' => '[\p{Lu}\p{Ll}0-9]+'), + 'FIELD_INVALID_CHARS_LETTER_NUM_ONLY-field', + 'Required field should reject spaces in UTF-8 letternumeric only field', + ), + array( + 'Имя123', + array('field_validation' => '[\p{Lu}\p{Ll}0-9]+'), + false, + 'Required field should accept UTF-8 letternumeric only field', + ), + array( + 'Ö äö äö- ä+', + array('field_validation' => '[\p{Lu}\p{Ll}0-9_]+'), + 'FIELD_INVALID_CHARS_LETTER_NUM_UNDERSCORE-field', + 'Required field should reject spacers in UTF-8 letternumeric with underscore field', + ), + array( + 'Правильное.Имя123', + array('field_validation' => '[\p{Lu}\p{Ll}0-9.]+'), + false, + 'Required field should accept UTF-8 letternumeric field with dots', + ), + array( + 'Неправильное.,имя123', + array('field_validation' => '[\p{Lu}\p{Ll}0-9.]+'), + 'FIELD_INVALID_CHARS_LETTER_NUM_DOTS-field', + 'Required field should reject comma in UTF-8 letternumeric field with dots', + ), + array( + 'Ö äö äö- ä+', + array('field_validation' => '[\p{Lu}\p{Ll}0-9\x20_+\-\[\]]+'), + false, + 'Required field should accept spacers in UTF-8 letternumeric with spacers field', + ), + array( + 'skype.test.name,_this', + array('field_validation' => '[\p{Lu}\p{Ll}][\p{Lu}\p{Ll}0-9.,\-_]+'), + false, + 'Required field should accept alphanumeric value for UTF-8 letternumeric field with punctuations', + ), + array( + '1skype.this.should.fail', + array('field_validation' => '[\p{Lu}\p{Ll}][\p{Lu}\p{Ll}0-9.,\-_]+'), + 'FIELD_INVALID_CHARS_LETTER_NUM_PUNCTUATION-field', + 'Required field should reject field having leading numeric for UTF-8 letternumeric field with punctuations', + ), ); } |