diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-07-04 13:32:10 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-07-04 13:32:10 +0200 |
commit | 4558262e2aaf31b4583a87622e97a46ead11537c (patch) | |
tree | 88a589e5f9b3b45139c32718c1caf12a5e3b1374 /tests/test_framework/phpbb_functional_test_case.php | |
parent | 4b49b3dcf3bc369eaced5790b95914254ab7d932 (diff) | |
parent | 86e21a9b261d6239487c626b7e9c9f462ceab611 (diff) | |
download | forums-4558262e2aaf31b4583a87622e97a46ead11537c.tar forums-4558262e2aaf31b4583a87622e97a46ead11537c.tar.gz forums-4558262e2aaf31b4583a87622e97a46ead11537c.tar.bz2 forums-4558262e2aaf31b4583a87622e97a46ead11537c.tar.xz forums-4558262e2aaf31b4583a87622e97a46ead11537c.zip |
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus:
[ticket/12013] Fix functional tests and sniffer issue.
[ticket/12013] Clear the jumpbox.
[ticket/12013] Add moderator tools icon.
[ticket/12013] Remove obsolete jumpbox and quickmod CSS.
[ticket/12013] Prevent the dropdown scrollbar from overlapping the content.
[ticket/12013] Update to use the new .button class.
[ticket/12013] Add missing class to place the buttons on the rightside.
[ticket/12013] Use the correct variable for the forum id.
[ticket/12013] Use DEFINE instead of Twig's set.
[ticket/12013] Use path helper.
[ticket/12013] Use new dropdown for quickmod tools and jumpbox.
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.'))); + } } |