diff options
author | Andreas Fischer <bantu@phpbb.com> | 2011-01-16 20:03:08 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2011-01-16 20:13:05 +0100 |
commit | 97be6e794647d0853274c5d8e68a9fbe727dba51 (patch) | |
tree | c767c332a8226ce2b8e9166fd9935cc06b86669b /tests/regex/censor_test.php | |
parent | 8c1866bc0c1ac4a3b58edfaf3f3914361deb1fab (diff) | |
download | forums-97be6e794647d0853274c5d8e68a9fbe727dba51.tar forums-97be6e794647d0853274c5d8e68a9fbe727dba51.tar.gz forums-97be6e794647d0853274c5d8e68a9fbe727dba51.tar.bz2 forums-97be6e794647d0853274c5d8e68a9fbe727dba51.tar.xz forums-97be6e794647d0853274c5d8e68a9fbe727dba51.zip |
[ticket/9933] Add $use_unicode parameter to get_censor_preg_expression().
Rename $unicode to $unicode_support, pass in $use_unicode defaulting to true.
In unit tests we can now pass in $use_unicode as false and also test the code
path that is taken when PCRE does not support unicode.
PHPBB3-9933
Diffstat (limited to 'tests/regex/censor_test.php')
-rw-r--r-- | tests/regex/censor_test.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/regex/censor_test.php b/tests/regex/censor_test.php index ae2d86e07e..93c761c8d0 100644 --- a/tests/regex/censor_test.php +++ b/tests/regex/censor_test.php @@ -31,9 +31,19 @@ class phpbb_regex_censor_test extends phpbb_test_case /** * @dataProvider censor_test_data */ - public function test_censor($pattern, $subject) + public function test_censor_unicode($pattern, $subject) { - $regex = get_censor_preg_expression($pattern); + $regex = get_censor_preg_expression($pattern, true); + + $this->assertRegExp($regex, $subject); + } + + /** + * @dataProvider censor_test_data + */ + public function test_censor_no_unicode($pattern, $subject) + { + $regex = get_censor_preg_expression($pattern, false); $this->assertRegExp($regex, $subject); } |