diff options
Diffstat (limited to 'tests/test_framework/phpbb_functional_test_case.php')
-rw-r--r-- | tests/test_framework/phpbb_functional_test_case.php | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index eef30fbcc7..07ef826abf 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -971,12 +971,8 @@ class phpbb_functional_test_case extends phpbb_mink_test_case */ public function delete_topic($topic_id) { - $crawler = self::request('GET', "viewtopic.php?t={$topic_id}&sid={$this->sid}"); - $this->add_lang('posting'); - $form = $crawler->selectButton('Go')->eq(1)->form(); - $form['action']->select('delete_topic'); - $crawler = self::submit($form); + $crawler = $this->get_quickmod_page($topic_id, 'DELETE_TOPIC'); $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text()); $this->add_lang('mcp'); @@ -1067,4 +1063,25 @@ class phpbb_functional_test_case extends phpbb_mink_test_case return $manager; } + + /** + * Get quickmod page + * + * @param int $topic_id + * @param string $action Language key for the quickmod action + * @param Symfony\Component\DomCrawler\Crawler Optional crawler object to use instead of creating new one. + * @return Symfony\Component\DomCrawler\Crawler + */ + public function get_quickmod_page($topic_id, $action, $crawler = false) + { + $this->add_lang('viewtopic'); + + if ($crawler === false) + { + $crawler = self::request('GET', "viewtopic.php?t={$topic_id}&sid={$this->sid}"); + } + $link = $crawler->filter('#quickmod')->selectLink($this->lang($action))->link()->getUri(); + + return self::request('GET', substr($link, strpos($link, 'mcp.'))); + } } |