diff options
author | Cesar G <prototech91@gmail.com> | 2014-06-14 15:36:36 -0700 |
---|---|---|
committer | Cesar G <prototech91@gmail.com> | 2014-07-04 01:22:32 -0700 |
commit | d95c97c3b4bd3f6efbdf3b457e6f9377fed640d3 (patch) | |
tree | 95c75df9797da1734c4a53a37065b699070f5b77 /tests/test_framework | |
parent | ddf3ab323bb0cd45063917e6cd0c54a37eef5d6e (diff) | |
download | forums-d95c97c3b4bd3f6efbdf3b457e6f9377fed640d3.tar forums-d95c97c3b4bd3f6efbdf3b457e6f9377fed640d3.tar.gz forums-d95c97c3b4bd3f6efbdf3b457e6f9377fed640d3.tar.bz2 forums-d95c97c3b4bd3f6efbdf3b457e6f9377fed640d3.tar.xz forums-d95c97c3b4bd3f6efbdf3b457e6f9377fed640d3.zip |
[ticket/12013] Fix functional tests and sniffer issue.
PHPBB3-12013
Diffstat (limited to 'tests/test_framework')
-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.'))); + } } |