From 244ff0f969f197c7e816604185ede8ea6f892d9b Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 20 Oct 2016 01:11:14 +0700 Subject: [ticket/14830] Fix ACP search control functional tests PHPBB3-14830 --- tests/functional/search/base.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/functional') diff --git a/tests/functional/search/base.php b/tests/functional/search/base.php index d41e3ec925..7c201169df 100644 --- a/tests/functional/search/base.php +++ b/tests/functional/search/base.php @@ -38,7 +38,7 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case $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); + $crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=settings&sid=' . $this->sid . '&hash=' . generate_link_hash('acp_search')); $form = $crawler->selectButton('Submit')->form(); $values = $form->getValues(); @@ -75,11 +75,11 @@ 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); + $crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid . '&hash=' . generate_link_hash('acp_search')); $form_values = $crawler->selectButton('Delete index')->form()->getValues(); $crawler = self::request( 'POST', - 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid, + 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid . '&hash=' . generate_link_hash('acp_search'), array( 'search_type' => $this->search_backend, 'action' => 'create', @@ -94,11 +94,11 @@ 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); + $crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid . '&hash=' . generate_link_hash('acp_search')); $form_values = $crawler->selectButton('Delete index')->form()->getValues(); $crawler = self::request( 'POST', - 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid, + 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid . '&hash=' . generate_link_hash('acp_search'), array( 'search_type' => $this->search_backend, 'action' => 'delete', -- cgit v1.2.1 From 8afa9fdf28cec82b8d68ad40b90bc5cc2d214f78 Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 20 Oct 2016 01:31:15 +0700 Subject: =?UTF-8?q?[ticket/14830]=20Fix=20FORM=5FINVALID=20error=20during?= =?UTF-8?q?=20A=D0=A1P=20search=20index=20deletion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PHPBB3-14830 --- tests/functional/search/base.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/functional') diff --git a/tests/functional/search/base.php b/tests/functional/search/base.php index 7c201169df..9b80407b5d 100644 --- a/tests/functional/search/base.php +++ b/tests/functional/search/base.php @@ -38,7 +38,7 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case $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 . '&hash=' . generate_link_hash('acp_search')); + $crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=settings&sid=' . $this->sid); $form = $crawler->selectButton('Submit')->form(); $values = $form->getValues(); @@ -75,11 +75,11 @@ 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 . '&hash=' . generate_link_hash('acp_search')); - $form_values = $crawler->selectButton('Delete index')->form()->getValues(); + $crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid); + $form_values = $crawler->selectButton('Create index')->form()->getValues(); $crawler = self::request( 'POST', - 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid . '&hash=' . generate_link_hash('acp_search'), + 'adm/index.php?i=acp_search&mode=index&hash=' . generate_link_hash('acp_search') . '&sid=' . $this->sid, array( 'search_type' => $this->search_backend, 'action' => 'create', @@ -94,11 +94,11 @@ 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 . '&hash=' . generate_link_hash('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 . '&hash=' . generate_link_hash('acp_search'), + 'adm/index.php?i=acp_search&mode=index&hash=' . generate_link_hash('acp_search') . '&sid=' . $this->sid, array( 'search_type' => $this->search_backend, 'action' => 'delete', -- cgit v1.2.1 From cefbd39b82a3e6e425414744ae39fdc1a6e67504 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 24 Oct 2016 01:38:27 +0700 Subject: [ticket/14830] Fix tests PHPBB3-14830 --- tests/functional/search/base.php | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'tests/functional') diff --git a/tests/functional/search/base.php b/tests/functional/search/base.php index 9b80407b5d..f1e9b517d4 100644 --- a/tests/functional/search/base.php +++ b/tests/functional/search/base.php @@ -76,18 +76,16 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case { $this->add_lang('acp/search'); $crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=index&sid=' . $this->sid); - $form_values = $crawler->selectButton('Create index')->form()->getValues(); - $crawler = self::request( - 'POST', - 'adm/index.php?i=acp_search&mode=index&hash=' . generate_link_hash('acp_search') . '&sid=' . $this->sid, + $form = $crawler->selectButton('Create index')->form(); + $form_values = $form->getValues(); + $form_values = array_merge($form_values, array( 'search_type' => $this->search_backend, 'action' => 'create', - 'submit' => true, - 'form_token' => $form_values['form_token'], - 'creation_time' => $form_values['creation_time'], ) ); + $form->setValues($form_values); + $crawler = self::submit($form); $this->assertContainsLang('SEARCH_INDEX_CREATED', $crawler->text()); } @@ -95,18 +93,16 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case { $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&hash=' . generate_link_hash('acp_search') . '&sid=' . $this->sid, + $form = $crawler->selectButton('Delete index')->form(); + $form_values = $form->getValues(); + $form_values = array_merge($form_values, array( 'search_type' => $this->search_backend, 'action' => 'delete', - 'submit' => true, - 'form_token' => $form_values['form_token'], - 'creation_time' => $form_values['creation_time'], ) ); + $form->setValues($form_values); + $crawler = self::submit($form); $this->assertContainsLang('SEARCH_INDEX_REMOVED', $crawler->text()); } } -- cgit v1.2.1