aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mock/cache.php
diff options
context:
space:
mode:
authorCallum Macrae <callum@lynxphp.com>2011-08-22 15:35:47 +0100
committerCallum Macrae <callum@lynxphp.com>2011-08-22 19:02:27 +0100
commitfa5c7f6440282891dba1142920157971b90b5ad1 (patch)
tree4c5c6ae65dc58deceb718847df9c1ce7b03cc74f /tests/mock/cache.php
parent540ca1a8d88279b120b142c244c96c9fae9a867b (diff)
downloadforums-fa5c7f6440282891dba1142920157971b90b5ad1.tar
forums-fa5c7f6440282891dba1142920157971b90b5ad1.tar.gz
forums-fa5c7f6440282891dba1142920157971b90b5ad1.tar.bz2
forums-fa5c7f6440282891dba1142920157971b90b5ad1.tar.xz
forums-fa5c7f6440282891dba1142920157971b90b5ad1.zip
[ticket/10240] Added censor_text tests.
PHPBB-10240
Diffstat (limited to 'tests/mock/cache.php')
-rw-r--r--tests/mock/cache.php22
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)
{