From 97be6e794647d0853274c5d8e68a9fbe727dba51 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 16 Jan 2011 20:03:08 +0100 Subject: [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 --- tests/regex/censor_test.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tests/regex/censor_test.php') 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); } -- cgit v1.2.1