aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2012-11-12 16:22:10 +0100
committerOleg Pudeyev <oleg@bsdpower.com>2012-11-27 08:49:06 -0500
commit9d597dc2ee152f448139dc708663f9a81e5cb209 (patch)
tree970fa6f1072ea012dda3fe5271cedcc30cda47ce
parent2d1ac34de60a15e0b9e00a30140a08b4e329099d (diff)
downloadforums-9d597dc2ee152f448139dc708663f9a81e5cb209.tar
forums-9d597dc2ee152f448139dc708663f9a81e5cb209.tar.gz
forums-9d597dc2ee152f448139dc708663f9a81e5cb209.tar.bz2
forums-9d597dc2ee152f448139dc708663f9a81e5cb209.tar.xz
forums-9d597dc2ee152f448139dc708663f9a81e5cb209.zip
[ticket/11174] set config values
set config values and use min length as 4 for wordss in test cases PHPBB3-11174
-rw-r--r--tests/search/mysql_test.php25
1 files changed, 18 insertions, 7 deletions
diff --git a/tests/search/mysql_test.php b/tests/search/mysql_test.php
index d9da2dfb2d..44043da40d 100644
--- a/tests/search/mysql_test.php
+++ b/tests/search/mysql_test.php
@@ -42,6 +42,10 @@ class phpbb_search_mysql_test extends phpbb_database_test_case
// dbal uses cache
$cache = new phpbb_cache_driver_null;
+ // set config values
+ $config['fulltext_mysql_min_word_len'] = 4;
+ $config['fulltext_mysql_max_word_len'] = 254;
+
$this->db = $this->new_dbal();
$error = null;
$class = phpbb_search_wrapper('phpbb_search_fulltext_mysql');
@@ -77,10 +81,10 @@ class phpbb_search_mysql_test extends phpbb_database_test_case
),
// leading, trailing and multiple spaces
array(
- ' foo bar ',
+ ' fooo baar ',
'all',
true,
- array('foo', 'bar'),
+ array('fooo', 'baar'),
array(),
),
// words too short
@@ -100,25 +104,32 @@ class phpbb_search_mysql_test extends phpbb_database_test_case
array('f', 'o', 'o'),
),
array(
- 'foo -bar',
+ 'f -o -o',
+ 'all',
+ false,
+ null,
+ array('f', '-o', '-o'),
+ ),
+ array(
+ 'fooo -baar',
'all',
true,
- array('-bar', 'foo'),
+ array('-baar', 'fooo'),
array(),
),
// all negative
array(
- '-foo',
+ '-fooo',
'all',
false,
null,
array(),
),
array(
- '-foo -bar',
+ '-fooo -baar',
'all',
false,
- array('-foo', '-bar'),
+ array('-fooo', '-baar'),
array(),
),
);