diff options
author | Andreas Fischer <bantu@phpbb.com> | 2013-08-15 01:40:08 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2013-08-15 01:40:08 +0200 |
commit | 1ac1b9b7ee1f1904503b28c00dc7f86a34c007b3 (patch) | |
tree | e5d609354d5e582c80092213bd6f094a87003862 | |
parent | 585f692e3168203645bf40d21c51309ab6572b68 (diff) | |
parent | d089f9693accf9cb6a1fbabb5545b340a963b501 (diff) | |
download | forums-1ac1b9b7ee1f1904503b28c00dc7f86a34c007b3.tar forums-1ac1b9b7ee1f1904503b28c00dc7f86a34c007b3.tar.gz forums-1ac1b9b7ee1f1904503b28c00dc7f86a34c007b3.tar.bz2 forums-1ac1b9b7ee1f1904503b28c00dc7f86a34c007b3.tar.xz forums-1ac1b9b7ee1f1904503b28c00dc7f86a34c007b3.zip |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[ticket/11775] Fix doc blocks syntax
[ticket/11775] Remove spaces at line ends
[ticket/11775] Split test into multiple steps
[ticket/11775] Add functional test for moving the last post
[ticket/11775] Backport moving of the posting functions to 3.0
[ticket/11775] Fix error when moving the last post to another topic
Conflicts:
tests/test_framework/phpbb_functional_test_case.php
-rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 4 | ||||
-rw-r--r-- | tests/functional/mcp_test.php | 67 | ||||
-rw-r--r-- | tests/test_framework/phpbb_functional_test_case.php | 2 |
3 files changed, 70 insertions, 3 deletions
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index b282258c08..9c294b96c8 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -669,10 +669,10 @@ function merge_posts($topic_id, $to_topic_id) } // If the topic no longer exist, we will update the topic watch table. - phpbb_update_rows_avoiding_duplicates_notify_status($db, TOPICS_WATCH_TABLE, 'topic_id', $topic_ids, $to_topic_id); + phpbb_update_rows_avoiding_duplicates_notify_status($db, TOPICS_WATCH_TABLE, 'topic_id', array($topic_id), $to_topic_id); // If the topic no longer exist, we will update the bookmarks table. - phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', $topic_id, $to_topic_id); + phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', array($topic_id), $to_topic_id); } // Link to the new topic diff --git a/tests/functional/mcp_test.php b/tests/functional/mcp_test.php new file mode 100644 index 0000000000..f65a7d0784 --- /dev/null +++ b/tests/functional/mcp_test.php @@ -0,0 +1,67 @@ +<?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()); + + return $crawler; + } + + /** + * @depends test_post_new_topic + */ + public function test_handle_quickmod($crawler) + { + // Test moving a post + $form = $crawler->selectButton('Go')->eq(1)->form(); + $form['action']->select('merge'); + $crawler = self::submit($form); + + return $crawler; + } + + /** + * @depends test_handle_quickmod + */ + public function test_move_post_to_topic($crawler) + { + // 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()); + + return $crawler; + } + + /** + * @depends test_move_post_to_topic + */ + public function test_confirm_result($crawler) + { + $this->add_lang('mcp'); + $form = $crawler->selectButton('Yes')->form(); + $crawler = self::submit($form); + $this->assertContains($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text()); + } +} diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index de3611c4cc..ce748bb9cf 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -957,7 +957,7 @@ class phpbb_functional_test_case extends phpbb_test_case ); } - /* + /** * Returns the requested parameter from a URL * * @param string $url |