mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-21 00:02:18 +02:00
[ticket/12738] Fix tests with new config object injection
PHPBB3-12738
This commit is contained in:
parent
1a79de4214
commit
eeb2c128f5
@ -271,7 +271,8 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
|
||||
$config['search_type'] = 'phpbb_mock_search';
|
||||
$cache = new phpbb_mock_cache;
|
||||
$db = $this->new_dbal();
|
||||
set_config_count(null, null, null, new \phpbb\config\config(array('num_posts' => 3, 'num_topics' => 1)));
|
||||
$phpbb_config = new \phpbb\config\config(array('num_posts' => 3, 'num_topics' => 1));
|
||||
set_config_count(null, null, null, $phpbb_config);
|
||||
|
||||
// Create auth mock
|
||||
$auth = $this->getMock('\phpbb\auth\auth');
|
||||
@ -285,7 +286,7 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
|
||||
|
||||
$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));
|
||||
$phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $phpbb_config, $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);
|
||||
|
||||
|
@ -135,7 +135,8 @@ class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_data
|
||||
->with($this->stringContains('_'), $this->anything())
|
||||
->will($this->returnValueMap($permissions));
|
||||
$user = $this->getMock('\phpbb\user');
|
||||
$content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||
$config = new phpbb\config\config(array());
|
||||
$content_visibility = new \phpbb\content_visibility($auth, $config, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||
|
||||
$result = $db->sql_query('SELECT ' . $mode . '_id
|
||||
FROM ' . $table . '
|
||||
|
@ -135,7 +135,8 @@ class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_data
|
||||
->with($this->stringContains('_'), $this->anything())
|
||||
->will($this->returnValueMap($permissions));
|
||||
$user = $this->getMock('\phpbb\user');
|
||||
$content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||
$config = new phpbb\config\config(array());
|
||||
$content_visibility = new \phpbb\content_visibility($auth, $config, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||
|
||||
$result = $db->sql_query('SELECT ' . $mode . '_id
|
||||
FROM ' . $table . '
|
||||
|
@ -82,7 +82,8 @@ class phpbb_content_visibility_get_visibility_sql_test extends phpbb_database_te
|
||||
->with($this->stringContains('_'), $this->anything())
|
||||
->will($this->returnValueMap($permissions));
|
||||
$user = $this->getMock('\phpbb\user');
|
||||
$content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||
$config = new phpbb\config\config(array());
|
||||
$content_visibility = new \phpbb\content_visibility($auth, $config, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||
|
||||
$result = $db->sql_query('SELECT ' . $mode . '_id
|
||||
FROM ' . $table . '
|
||||
|
@ -125,7 +125,8 @@ class phpbb_content_visibility_set_post_visibility_test extends phpbb_database_t
|
||||
$db = $this->new_dbal();
|
||||
$auth = $this->getMock('\phpbb\auth\auth');
|
||||
$user = $this->getMock('\phpbb\user');
|
||||
$content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||
$config = new phpbb\config\config(array());
|
||||
$content_visibility = new \phpbb\content_visibility($auth, $config, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||
|
||||
$content_visibility->set_post_visibility($visibility, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest);
|
||||
|
||||
@ -174,7 +175,8 @@ class phpbb_content_visibility_set_post_visibility_test extends phpbb_database_t
|
||||
$db = $this->new_dbal();
|
||||
$auth = $this->getMock('\phpbb\auth\auth');
|
||||
$user = $this->getMock('\phpbb\user');
|
||||
$content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||
$config = new phpbb\config\config(array());
|
||||
$content_visibility = new \phpbb\content_visibility($auth, $config, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||
|
||||
$content_visibility->set_post_visibility(ITEM_DELETED, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest);
|
||||
|
||||
|
@ -89,7 +89,8 @@ class phpbb_content_visibility_set_topic_visibility_test extends phpbb_database_
|
||||
$db = $this->new_dbal();
|
||||
$auth = $this->getMock('\phpbb\auth\auth');
|
||||
$user = $this->getMock('\phpbb\user');
|
||||
$content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||
$config = new phpbb\config\config(array());
|
||||
$content_visibility = new \phpbb\content_visibility($auth, $config, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||
|
||||
$content_visibility->set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user