2013-08-09 00:41:28 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
*
|
2014-05-27 20:18:06 +02:00
|
|
|
* This file is part of the phpBB Forum Software package.
|
|
|
|
*
|
|
|
|
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
|
|
|
* @license GNU General Public License, version 2 (GPL-2.0)
|
|
|
|
*
|
|
|
|
* For full copyright and license information, please see
|
|
|
|
* the docs/CREDITS.txt file.
|
2013-08-09 00:41:28 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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());
|
|
|
|
|
2013-08-12 15:31:19 +02:00
|
|
|
return $crawler;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @depends test_post_new_topic
|
|
|
|
*/
|
|
|
|
public function test_handle_quickmod($crawler)
|
|
|
|
{
|
2013-08-09 00:41:28 +02:00
|
|
|
// Test moving a post
|
|
|
|
$form = $crawler->selectButton('Go')->eq(1)->form();
|
|
|
|
$form['action']->select('merge');
|
|
|
|
$crawler = self::submit($form);
|
|
|
|
|
2013-08-12 15:31:19 +02:00
|
|
|
return $crawler;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @depends test_handle_quickmod
|
|
|
|
*/
|
|
|
|
public function test_move_post_to_topic($crawler)
|
|
|
|
{
|
2013-08-09 00:41:28 +02:00
|
|
|
// 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());
|
|
|
|
|
2013-08-12 15:31:19 +02:00
|
|
|
return $crawler;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @depends test_move_post_to_topic
|
|
|
|
*/
|
|
|
|
public function test_confirm_result($crawler)
|
|
|
|
{
|
|
|
|
$this->add_lang('mcp');
|
2013-08-09 00:41:28 +02:00
|
|
|
$form = $crawler->selectButton('Yes')->form();
|
|
|
|
$crawler = self::submit($form);
|
|
|
|
$this->assertContains($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text());
|
|
|
|
}
|
|
|
|
}
|