diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-08-09 00:41:28 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-08-09 00:41:28 +0200 |
commit | a9b5e77e684043924f8c34c8782b32a0f146228c (patch) | |
tree | 00a60c356ef7d8d42f7645503ee0db4e0b089665 /tests | |
parent | a6e69f377bb436fe59eed9fdedc0cd735d8d8ce9 (diff) | |
download | forums-a9b5e77e684043924f8c34c8782b32a0f146228c.tar forums-a9b5e77e684043924f8c34c8782b32a0f146228c.tar.gz forums-a9b5e77e684043924f8c34c8782b32a0f146228c.tar.bz2 forums-a9b5e77e684043924f8c34c8782b32a0f146228c.tar.xz forums-a9b5e77e684043924f8c34c8782b32a0f146228c.zip |
[ticket/11775] Add functional test for moving the last post
PHPBB3-11775
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/mcp_test.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/functional/mcp_test.php b/tests/functional/mcp_test.php new file mode 100644 index 0000000000..f7e15de853 --- /dev/null +++ b/tests/functional/mcp_test.php @@ -0,0 +1,43 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2013 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @group functional +*/ +class phpbb_functional_mcp_test extends phpbb_functional_test_case +{ + public function test_post_new_topic() + { + $this->login(); + + // Test creating topic + $post = $this->create_topic(2, 'Test Topic 2', 'Testing move post with "Move posts" option from Quick-Moderator Tools.'); + + $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); + $this->assertContains('Testing move post with "Move posts" option from Quick-Moderator Tools.', $crawler->filter('html')->text()); + + // Test moving a post + $this->add_lang('mcp'); + $form = $crawler->selectButton('Go')->eq(1)->form(); + $form['action']->select('merge'); + $crawler = self::submit($form); + + // Select the post in MCP + $form = $crawler->selectButton($this->lang('SUBMIT'))->form(array( + 'to_topic_id' => 1, + )); + $form['post_id_list'][0]->tick(); + $crawler = self::submit($form); + $this->assertContains($this->lang('MERGE_POSTS'), $crawler->filter('html')->text()); + + $form = $crawler->selectButton('Yes')->form(); + $crawler = self::submit($form); + $this->assertContains($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text()); + } +} |