Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
14 / 14
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
phpbb_search_postgres_test
100.00% covered (success)
100.00%
14 / 14
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 getDataSet
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setUp
100.00% covered (success)
100.00%
13 / 13
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3*
4* This file is part of the phpBB Forum Software package.
5*
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
7* @license GNU General Public License, version 2 (GPL-2.0)
8*
9* For full copyright and license information, please see
10* the docs/CREDITS.txt file.
11*
12*/
13
14require_once __DIR__ . '/common_test_case.php';
15
16class phpbb_search_postgres_test extends phpbb_search_common_test_case
17{
18    protected $db;
19
20    public function getDataSet()
21    {
22        return $this->createXMLDataSet(__DIR__ . '/../fixtures/empty.xml');
23    }
24
25    protected function setUp(): void
26    {
27        global $phpbb_root_path, $phpEx, $config, $cache;
28
29        parent::setUp();
30
31        // dbal uses cache
32        $cache = $this->createMock('\phpbb\cache\service');
33        $language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx));
34        $user = $this->createMock('\phpbb\user');
35
36        //  set config values
37        $config = new \phpbb\config\config([
38            'fulltext_postgres_min_word_len' => 4,
39            'fulltext_postgres_max_word_len' => 254,
40        ]);
41
42        $this->db = $this->new_dbal();
43        $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
44        $class = self::get_search_wrapper('\phpbb\search\backend\fulltext_postgres');
45        $this->search = new $class($config, $this->db, $phpbb_dispatcher, $language, $user, SEARCH_RESULTS_TABLE, $phpbb_root_path, $phpEx);
46    }
47}