1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/10240] Added censor_text tests.

PHPBB-10240
This commit is contained in:
Callum Macrae
2011-08-22 15:35:47 +01:00
parent 540ca1a8d8
commit fa5c7f6440
3 changed files with 107 additions and 0 deletions

View File

@@ -41,6 +41,28 @@ class phpbb_mock_cache
{
return $this->data['_bots'];
}
/**
* Obtain list of word censors. We don't need to parse them here,
* that is tested elsewhere.
*/
public function obtain_word_list()
{
return array(
'match' => array(
'#(?<![\\p{Nd}\\p{L}_-])([\\p{Nd}\\p{L}_-]*?badword1[\\p{Nd}\\p{L}_-]*?)(?![\\p{Nd}\\p{L}_-])#iu',
'#(?<![\\p{Nd}\\p{L}_-])([\\p{Nd}\\p{L}_-]*?badword2)(?![\\p{Nd}\\p{L}_-])#iu',
'#(?<![\\p{Nd}\\p{L}_-])(badword3[\\p{Nd}\\p{L}_-]*?)(?![\\p{Nd}\\p{L}_-])#iu',
'#(?<![\\p{Nd}\\p{L}_-])(badword4)(?![\\p{Nd}\\p{L}_-])#iu',
),
'replace' => array(
'replacement1',
'replacement2',
'replacement3',
'replacement4',
),
);
}
public function set_bots($bots)
{