mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
[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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user