mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
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
This commit is contained in:
commit
1ac1b9b7ee
3 changed files with 70 additions and 3 deletions
|
@ -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.
|
// 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.
|
// 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
|
// Link to the new topic
|
||||||
|
|
67
tests/functional/mcp_test.php
Normal file
67
tests/functional/mcp_test.php
Normal file
|
@ -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());
|
||||||
|
}
|
||||||
|
}
|
|
@ -957,7 +957,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Returns the requested parameter from a URL
|
* Returns the requested parameter from a URL
|
||||||
*
|
*
|
||||||
* @param string $url
|
* @param string $url
|
||||||
|
|
Loading…
Add table
Reference in a new issue