mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/12933] Add test cases for * wildcard searches
PHPBB3-12933
This commit is contained in:
parent
252018b813
commit
35edd7a043
2 changed files with 60 additions and 0 deletions
|
@ -19,6 +19,11 @@
|
||||||
<value>commonword</value>
|
<value>commonword</value>
|
||||||
<value>commonword</value>
|
<value>commonword</value>
|
||||||
</row>
|
</row>
|
||||||
|
<row>
|
||||||
|
<value>baaz</value>
|
||||||
|
<value>baaz</value>
|
||||||
|
<value>baaz</value>
|
||||||
|
</row>
|
||||||
</table>
|
</table>
|
||||||
<table name="phpbb_search_wordlist">
|
<table name="phpbb_search_wordlist">
|
||||||
<column>word_id</column>
|
<column>word_id</column>
|
||||||
|
@ -39,5 +44,10 @@
|
||||||
<value>commonword</value>
|
<value>commonword</value>
|
||||||
<value>1</value>
|
<value>1</value>
|
||||||
</row>
|
</row>
|
||||||
|
<row>
|
||||||
|
<value>4</value>
|
||||||
|
<value>baaz</value>
|
||||||
|
<value>0</value>
|
||||||
|
</row>
|
||||||
</table>
|
</table>
|
||||||
</dataset>
|
</dataset>
|
||||||
|
|
|
@ -35,6 +35,8 @@ class phpbb_search_native_test extends phpbb_search_test_case
|
||||||
$this->db = $this->new_dbal();
|
$this->db = $this->new_dbal();
|
||||||
$error = null;
|
$error = null;
|
||||||
$class = self::get_search_wrapper('\phpbb\search\fulltext_native');
|
$class = self::get_search_wrapper('\phpbb\search\fulltext_native');
|
||||||
|
$config['fulltext_native_min_chars'] = 2;
|
||||||
|
$config['fulltext_native_max_chars'] = 14;
|
||||||
$this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user);
|
$this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +57,54 @@ class phpbb_search_native_test extends phpbb_search_test_case
|
||||||
array(),
|
array(),
|
||||||
array(),
|
array(),
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'baaz*',
|
||||||
|
'all',
|
||||||
|
true,
|
||||||
|
array('\'baaz%\''),
|
||||||
|
array(),
|
||||||
|
array(),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'ba*az',
|
||||||
|
'all',
|
||||||
|
true,
|
||||||
|
array('\'ba%az\''),
|
||||||
|
array(),
|
||||||
|
array(),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'ba*z',
|
||||||
|
'all',
|
||||||
|
true,
|
||||||
|
array('\'ba%z\''),
|
||||||
|
array(),
|
||||||
|
array(),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'baa* baaz*',
|
||||||
|
'all',
|
||||||
|
true,
|
||||||
|
array('\'baa%\'', '\'baaz%\''),
|
||||||
|
array(),
|
||||||
|
array(),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'ba*z baa*',
|
||||||
|
'all',
|
||||||
|
true,
|
||||||
|
array('\'ba%z\'', '\'baa%\''),
|
||||||
|
array(),
|
||||||
|
array(),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'baaz* commonword',
|
||||||
|
'all',
|
||||||
|
true,
|
||||||
|
array('\'baaz%\''),
|
||||||
|
array(),
|
||||||
|
array('commonword'),
|
||||||
|
),
|
||||||
array(
|
array(
|
||||||
'foo bar',
|
'foo bar',
|
||||||
'all',
|
'all',
|
||||||
|
|
Loading…
Add table
Reference in a new issue