mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-21 17:11:53 +02:00
[ticket/14789] Add form tokens to tests and uncomment add_form_key
PHPBB3-14789
This commit is contained in:
@@ -254,7 +254,7 @@ class acp_search
|
||||
$submit = $request->is_set_post('submit', false);
|
||||
|
||||
$form_key = 'acp_search';
|
||||
//add_form_key($form_key);
|
||||
add_form_key($form_key);
|
||||
|
||||
if (!check_form_key($form_key) && in_array($action, array('delete', 'create')))
|
||||
{
|
||||
|
@@ -75,6 +75,8 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
|
||||
protected function create_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,
|
||||
@@ -82,6 +84,8 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
|
||||
'search_type' => $this->search_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 +94,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 +103,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());
|
||||
|
Reference in New Issue
Block a user