diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-03-14 10:13:42 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-03-14 10:13:42 +0100 |
commit | 5f8f1f04fdcc30b0d2c3173661eb8eefbc371a4d (patch) | |
tree | 3c9fe1936aa216b0fe9d22299963aa9c7e116b5d /tests/test_framework | |
parent | 3c6a17ae6bc494d68f7230c932e9ac036207ce77 (diff) | |
parent | 6918921d53da75bf1b77dcbffff10e8dc574fbdb (diff) | |
download | forums-5f8f1f04fdcc30b0d2c3173661eb8eefbc371a4d.tar forums-5f8f1f04fdcc30b0d2c3173661eb8eefbc371a4d.tar.gz forums-5f8f1f04fdcc30b0d2c3173661eb8eefbc371a4d.tar.bz2 forums-5f8f1f04fdcc30b0d2c3173661eb8eefbc371a4d.tar.xz forums-5f8f1f04fdcc30b0d2c3173661eb8eefbc371a4d.zip |
Merge remote-tracking branch 'dhruv/ticket/11040' into develop
* dhruv/ticket/11040:
[ticket/11040] Topic is deleted if test is skipped
[ticket/11040] Use unique text for the test post added
[ticket/11040] Use hard delete in delete_topic
[ticket/11040] Add migration to drop postgres search indexes
[ticket/11040] Delete the functional test topic to avoid conflicts
[ticket/11040] Add methods to delete post and topic in functional tests
[ticket/11040] Swap post_text and post_subject for post_content index
[ticket/11040] Add test cases for searching subject and post content together
[ticket/11040] Remove postgres extra indexes
[ticket/11040] Add post_content index
[ticket/11040] Search subject and text together
Diffstat (limited to 'tests/test_framework')
-rw-r--r-- | tests/test_framework/phpbb_functional_test_case.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index a1a4ed73e2..d6eb4a632f 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -1004,6 +1004,52 @@ class phpbb_functional_test_case extends phpbb_test_case } /** + * Deletes a topic + * + * Be sure to login before creating + * + * @param int $topic_id + * @return null + */ + 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); + $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text()); + + $this->add_lang('mcp'); + $form = $crawler->selectButton('Yes')->form(); + $form['delete_permanent'] = 1; + $crawler = self::submit($form); + $this->assertContainsLang('TOPIC_DELETED_SUCCESS', $crawler->text()); + } + + /** + * Deletes a post + * + * Be sure to login before creating + * + * @param int $forum_id + * @param int $topic_id + * @return null + */ + public function delete_post($forum_id, $post_id) + { + $this->add_lang('posting'); + $crawler = self::request('GET', "posting.php?mode=delete&f={$forum_id}&p={$post_id}&sid={$this->sid}"); + $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text()); + + $form = $crawler->selectButton('Yes')->form(); + $form['delete_permanent'] = 1; + $crawler = self::submit($form); + $this->assertContainsLang('POST_DELETED', $crawler->text()); + } + + /** * Returns the requested parameter from a URL * * @param string $url |