1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge pull request #6345 from marc1706/ticket/16935

[ticket/16935] Refactor sphinx to use new clases and remove unused parts
This commit is contained in:
Marc Alexander
2022-01-22 09:04:43 +01:00
committed by GitHub
10 changed files with 268 additions and 362 deletions

View File

@@ -98,6 +98,12 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
{
$values["config[search_type]"] = $this->search_backend;
if (strpos($this->search_backend, 'fulltext_sphinx'))
{
// Set board Sphinx id in according to respective setup-sphinx.sh $ID value
$values["config[fulltext_sphinx_id]"] = 'saw9zf2fdhp1goue';
}
try
{
$form->setValues($values);
@@ -111,6 +117,7 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
}
$crawler = self::submit($form);
$this->purge_cache();
$form = $crawler->selectButton($this->lang('YES'))->form();
$values = $form->getValues();

View File

@@ -20,8 +20,29 @@ class phpbb_functional_search_sphinx_test extends phpbb_functional_search_base
{
protected $search_backend = 'phpbb\search\backend\fulltext_sphinx';
protected function create_search_index($backend = null)
{
parent::create_search_index($backend);
$this->purge_cache();
if (!$backend || $this->search_backend == $backend)
{
// After creating phpBB search index, build Sphinx index
exec('sudo -S service sphinxsearch stop', $output, $retval); // Attemtp 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();
}
}
}