diff options
author | Callum Macrae <callum@lynxphp.com> | 2011-08-22 15:35:47 +0100 |
---|---|---|
committer | Callum Macrae <callum@lynxphp.com> | 2011-08-22 19:02:27 +0100 |
commit | fa5c7f6440282891dba1142920157971b90b5ad1 (patch) | |
tree | 4c5c6ae65dc58deceb718847df9c1ce7b03cc74f /tests/mock/cache.php | |
parent | Merge remote-tracking branch 'nickvergessen/ticket/8177' into develop-olympus (diff) | |
download | phpbb-fa5c7f6440282891dba1142920157971b90b5ad1.tar.gz phpbb-fa5c7f6440282891dba1142920157971b90b5ad1.tar.bz2 phpbb-fa5c7f6440282891dba1142920157971b90b5ad1.zip |
[ticket/10240] Added censor_text tests.
PHPBB-10240
Diffstat (limited to 'tests/mock/cache.php')
-rw-r--r-- | tests/mock/cache.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/mock/cache.php b/tests/mock/cache.php index 11e525ff79..020574b0bb 100644 --- a/tests/mock/cache.php +++ b/tests/mock/cache.php @@ -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) { |