Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| phpbb_functional_search_mysql_test | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 1 |
| setUp | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| create_search_index | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| 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 | |
| 14 | require_once __DIR__ . '/base.php'; |
| 15 | |
| 16 | /** |
| 17 | * @group functional |
| 18 | */ |
| 19 | class phpbb_functional_search_mysql_test extends phpbb_functional_search_base |
| 20 | { |
| 21 | protected $search_backend = 'phpbb\search\backend\fulltext_mysql'; |
| 22 | |
| 23 | protected function setUp(): void |
| 24 | { |
| 25 | $sql_layer = substr(self::$config['dbms'], strlen('phpbb\\db\\driver\\')); |
| 26 | if ($sql_layer !== 'mysqli') // MySQL search backend runs on MySQL/MariaDB only |
| 27 | { |
| 28 | $this->markTestSkipped($sql_layer . ': MySQL search is not supported'); |
| 29 | } |
| 30 | |
| 31 | parent::setUp(); |
| 32 | } |
| 33 | |
| 34 | protected function create_search_index($backend = null) |
| 35 | { |
| 36 | parent::create_search_index($backend); |
| 37 | |
| 38 | // Try optimizing posts table after creating search index. |
| 39 | // Some versions of MariaDB might not return any results in the search |
| 40 | // until the table has been optimized or the index deleted and re-created. |
| 41 | $this->db->sql_return_on_error(true); |
| 42 | $sql = 'OPTIMIZE TABLE ' . POSTS_TABLE; |
| 43 | $this->db->sql_query($sql); |
| 44 | $this->db->sql_return_on_error(false); |
| 45 | } |
| 46 | } |