diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-11-27 09:06:56 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-11-27 09:06:56 -0500 |
commit | 7dcb03faf1e9c2374f5d5fd36e3b01e8f0315d73 (patch) | |
tree | 8e8b88f401a080a2022c74c336a4842cd12e5786 /tests/search/postgres_test.php | |
parent | cb2d029abf2d4857fa462f46af21728afde3cd28 (diff) | |
download | forums-7dcb03faf1e9c2374f5d5fd36e3b01e8f0315d73.tar forums-7dcb03faf1e9c2374f5d5fd36e3b01e8f0315d73.tar.gz forums-7dcb03faf1e9c2374f5d5fd36e3b01e8f0315d73.tar.bz2 forums-7dcb03faf1e9c2374f5d5fd36e3b01e8f0315d73.tar.xz forums-7dcb03faf1e9c2374f5d5fd36e3b01e8f0315d73.zip |
[ticket/11174] Delete more copy pasting.
PHPBB3-11174
Diffstat (limited to 'tests/search/postgres_test.php')
-rw-r--r-- | tests/search/postgres_test.php | 97 |
1 files changed, 2 insertions, 95 deletions
diff --git a/tests/search/postgres_test.php b/tests/search/postgres_test.php index b8c9bcfbe9..6a65e6bf8f 100644 --- a/tests/search/postgres_test.php +++ b/tests/search/postgres_test.php @@ -7,9 +7,9 @@ * */ -require_once dirname(__FILE__) . '/../test_framework/phpbb_search_test_case.php'; +require_once dirname(__FILE__) . '/common_test_case.php'; -class phpbb_search_postgres_test extends phpbb_search_test_case +class phpbb_search_postgres_test extends phpbb_search_common_test_case { protected $db; protected $search; @@ -37,97 +37,4 @@ class phpbb_search_postgres_test extends phpbb_search_test_case $class = self::get_search_wrapper('phpbb_search_fulltext_postgres'); $this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user); } - - public function keywords() - { - return array( - // keywords - // terms - // ok - // split words - // common words - array( - 'fooo', - 'all', - true, - array('fooo'), - array(), - ), - array( - 'fooo baar', - 'all', - true, - array('fooo', 'baar'), - array(), - ), - // leading, trailing and multiple spaces - array( - ' fooo baar ', - 'all', - true, - array('fooo', 'baar'), - array(), - ), - // words too short - array( - 'f', - 'all', - false, - null, - // short words count as "common" words - array('f'), - ), - array( - 'f o o', - 'all', - false, - null, - array('f', 'o', 'o'), - ), - array( - 'f -o -o', - 'all', - false, - null, - array('f', '-o', '-o'), - ), - array( - 'fooo -baar', - 'all', - true, - array('-baar', 'fooo'), - array(), - ), - // all negative - array( - '-fooo', - 'all', - true, - array('-fooo'), - array(), - ), - array( - '-fooo -baar', - 'all', - true, - array('-fooo', '-baar'), - array(), - ), - ); - } - - /** - * @dataProvider keywords - */ - public function test_split_keywords($keywords, $terms, $ok, $split_words, $common) - { - $rv = $this->search->split_keywords($keywords, $terms); - $this->assertEquals($ok, $rv); - if ($ok) - { - // only check criteria if the search is going to be performed - $this->assert_array_content_equals($split_words, $this->search->get_split_words()); - } - $this->assert_array_content_equals($common, $this->search->get_common_words()); - } } |