1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 03:04:09 +02:00

[ticket/16941] Add sphinx tests to 3.3.x

Also adjust Sphinx keywords splitting to be consistent with other search
backends when it comes to handling hyphen (like ignoring hyphen when it hasn't
NOT meaning and ignoring hyphen wrapped with "plus" signs)

PHPBB3-16941
This commit is contained in:
rxu
2021-12-12 10:53:56 +07:00
parent 4140d50f6a
commit 80a08d9c54
7 changed files with 263 additions and 6 deletions

View File

@@ -20,8 +20,31 @@ class phpbb_functional_search_sphinx_test extends phpbb_functional_search_base
{
protected $search_backend = '\phpbb\search\fulltext_sphinx';
protected function create_search_index($backend = null)
{
parent::create_search_index($backend);
$this->purge_cache();
if (!$backend || $this->search_backend == $backend)
{
$output = $retval = null;
// After creating phpBB search index, build Sphinx index
exec('sudo -S service sphinxsearch stop', $output, $retval); // Attempt to stop sphinxsearch service in case it's running
exec('sudo -S indexer --all', $output, $retval); // Run sphinxsearch indexer
exec('sudo -S service sphinxsearch start', $output, $retval); // Attempt to start sphinxsearch service again
}
}
public function test_search_backend()
{
$this->markTestIncomplete('Sphinx Tests are not supported');
if ($this->db->sql_layer != 'mysqli') // Sphinx test runs on MySQL/MariaDB only so far
{
$this->markTestIncomplete('Sphinx Tests are not supported');
}
else
{
parent::test_search_backend();
}
}
}