1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-30 19:49:54 +02:00

[ticket/9657] Fix unit tests

PHPBB3-9657
This commit is contained in:
Joas Schilling
2013-07-11 15:02:07 +02:00
parent 9aed758c13
commit 753dc62267
7 changed files with 34 additions and 24 deletions

View File

@@ -262,16 +262,13 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
*/
public function test_delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $reason, $expected_posts, $expected_topic, $expected_forum)
{
global $auth, $cache, $config, $db, $phpbb_container;
global $auth, $cache, $config, $db, $phpbb_container, $phpbb_root_path, $phpEx;
$config['search_type'] = 'phpbb_mock_search';
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
set_config_count(null, null, null, new phpbb_config(array('num_posts' => 3, 'num_topics' => 1)));
$phpbb_container = new phpbb_mock_container_builder();
$phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
// Create auth mock
$auth = $this->getMock('phpbb_auth');
$auth->expects($this->any())
@@ -280,6 +277,11 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
->will($this->returnValueMap(array(
array('m_approve', 1, true),
)));
$user = $this->getMock('phpbb_user');
$phpbb_container = new phpbb_mock_container_builder();
$phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
$phpbb_container->set('content.visibility', new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $reason);