From b7f69edaa273fec2b29a9300a766ffb9639686d2 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Sun, 26 Oct 2014 20:08:28 +0100 Subject: [ticket/12866] Assume underscore is part of \w PHPBB3-12866 --- tests/profilefields/type_string_test.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'tests/profilefields') diff --git a/tests/profilefields/type_string_test.php b/tests/profilefields/type_string_test.php index a7be087fb5..0417afbfab 100644 --- a/tests/profilefields/type_string_test.php +++ b/tests/profilefields/type_string_test.php @@ -133,37 +133,49 @@ class phpbb_profilefield_type_string_test extends phpbb_test_case ), array( 'ö äö äö ä', - array('field_validation' => '[\w]+'), + array('field_validation' => '[a-zA-Z0-9]+'), 'FIELD_INVALID_CHARS_ALPHA_ONLY-field', 'Required field should reject UTF-8 in alpha only field', ), + array( + 'a_abc', + array('field_validation' => '[a-zA-Z0-9]+'), + 'FIELD_INVALID_CHARS_ALPHA_ONLY-field', + 'Required field should reject underscore in alpha only field', + ), array( 'Hello', - array('field_validation' => '[\w]+'), + array('field_validation' => '[a-zA-Z0-9]+'), false, 'Required field should accept a characters only field', ), array( 'Valid.Username123', - array('field_validation' => '[\w.]+'), + array('field_validation' => '[a-zA-Z0-9.]+'), false, 'Required field should accept a alphanumeric field with dots', ), array( 'Invalid.,username123', - array('field_validation' => '[\w.]+'), + array('field_validation' => '[a-zA-Z0-9.]+'), 'FIELD_INVALID_CHARS_ALPHA_DOTS-field', 'Required field should reject field with comma', ), + array( + 'Invalid._username123', + array('field_validation' => '[a-zA-Z0-9.]+'), + 'FIELD_INVALID_CHARS_ALPHA_DOTS-field', + 'Required field should reject field with underscore', + ), array( 'skype.test.name,_this', - array('field_validation' => '[a-zA-Z][\w\.,\-_]+'), + array('field_validation' => '[a-zA-Z][\w\.,\-]+'), false, 'Required field should accept alphanumeric field with punctuations', ), array( '1skype.this.should.faila', - array('field_validation' => '[a-zA-Z][\w\.,\-_]+'), + array('field_validation' => '[a-zA-Z][\w\.,\-]+'), 'FIELD_INVALID_CHARS_ALPHA_PUNCTUATION-field', 'Required field should reject field having invalid input for the given validation', ), -- cgit v1.2.1