aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/search/base.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/search/base.php')
-rw-r--r--tests/functional/search/base.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/functional/search/base.php b/tests/functional/search/base.php
index 1d37d748df..f77ef70ecc 100644
--- a/tests/functional/search/base.php
+++ b/tests/functional/search/base.php
@@ -36,6 +36,8 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
$this->login();
$this->admin_login();
+ $this->create_search_index('\phpbb\search\fulltext_native');
+
$post = $this->create_topic(2, 'Test Topic 1 foosubject', 'This is a test topic posted by the barsearch testing framework.');
$crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=settings&sid=' . $this->sid);
@@ -58,6 +60,7 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
$this->delete_topic($post['topic_id']);
$this->markTestSkipped("Search backend is not supported/running");
}
+
$this->create_search_index();
}
@@ -72,16 +75,20 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
$this->delete_topic($post['topic_id']);
}
- protected function create_search_index()
+ protected function create_search_index($backend = null)
{
$this->add_lang('acp/search');
+ $crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid);
+ $form_values = $crawler->selectButton('Delete index')->form()->getValues();
$crawler = self::request(
'POST',
'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid,
array(
- 'search_type' => $this->search_backend,
+ 'search_type' => ( ($backend === null) ? $this->search_backend : $backend ),
'action' => 'create',
'submit' => true,
+ 'form_token' => $form_values['form_token'],
+ 'creation_time' => $form_values['creation_time'],
)
);
$this->assertContainsLang('SEARCH_INDEX_CREATED', $crawler->text());
@@ -90,6 +97,8 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
protected function delete_search_index()
{
$this->add_lang('acp/search');
+ $crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid);
+ $form_values = $crawler->selectButton('Delete index')->form()->getValues();
$crawler = self::request(
'POST',
'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid,
@@ -97,6 +106,8 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
'search_type' => $this->search_backend,
'action' => 'delete',
'submit' => true,
+ 'form_token' => $form_values['form_token'],
+ 'creation_time' => $form_values['creation_time'],
)
);
$this->assertContainsLang('SEARCH_INDEX_REMOVED', $crawler->text());