mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-05 15:16:16 +02:00
[ticket/13146] Setup mocks for tests with dispatcher
PHPBB3-13146
This commit is contained in:
parent
abc5dbcd71
commit
8376a027a1
@ -309,7 +309,10 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
|
|||||||
)));
|
)));
|
||||||
$user = new \phpbb\user('\phpbb\datetime');
|
$user = new \phpbb\user('\phpbb\datetime');
|
||||||
|
|
||||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
|
||||||
|
$phpbb_dispatcher = $this->getMockBuilder('\phpbb\event\dispatcher')
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
|
|
||||||
$phpbb_container = new phpbb_mock_container_builder();
|
$phpbb_container = new phpbb_mock_container_builder();
|
||||||
$phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
|
$phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
|
||||||
|
@ -136,7 +136,9 @@ class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_data
|
|||||||
->will($this->returnValueMap($permissions));
|
->will($this->returnValueMap($permissions));
|
||||||
$user = new \phpbb\user('\phpbb\datetime');
|
$user = new \phpbb\user('\phpbb\datetime');
|
||||||
$config = new phpbb\config\config(array());
|
$config = new phpbb\config\config(array());
|
||||||
$phpbb_dispatcher = $this->getMock('\phpbb\event\dispatcher');
|
$phpbb_dispatcher = $this->getMockBuilder('\phpbb\event\dispatcher')
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
$content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
$content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||||
|
|
||||||
$result = $db->sql_query('SELECT ' . $mode . '_id
|
$result = $db->sql_query('SELECT ' . $mode . '_id
|
||||||
|
@ -136,7 +136,9 @@ class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_data
|
|||||||
->will($this->returnValueMap($permissions));
|
->will($this->returnValueMap($permissions));
|
||||||
$user = new \phpbb\user('\phpbb\datetime');
|
$user = new \phpbb\user('\phpbb\datetime');
|
||||||
$config = new phpbb\config\config(array());
|
$config = new phpbb\config\config(array());
|
||||||
$phpbb_dispatcher = $this->getMock('\phpbb\event\dispatcher');
|
$phpbb_dispatcher = $this->getMockBuilder('\phpbb\event\dispatcher')
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
$content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
$content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||||
|
|
||||||
$result = $db->sql_query('SELECT ' . $mode . '_id
|
$result = $db->sql_query('SELECT ' . $mode . '_id
|
||||||
|
@ -83,7 +83,9 @@ class phpbb_content_visibility_get_visibility_sql_test extends phpbb_database_te
|
|||||||
->will($this->returnValueMap($permissions));
|
->will($this->returnValueMap($permissions));
|
||||||
$user = new \phpbb\user('\phpbb\datetime');
|
$user = new \phpbb\user('\phpbb\datetime');
|
||||||
$config = new phpbb\config\config(array());
|
$config = new phpbb\config\config(array());
|
||||||
$phpbb_dispatcher = $this->getMock('\phpbb\event\dispatcher');
|
$phpbb_dispatcher = $this->getMock('\phpbb\event\dispatcher')
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
$content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
$content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
||||||
|
|
||||||
$result = $db->sql_query('SELECT ' . $mode . '_id
|
$result = $db->sql_query('SELECT ' . $mode . '_id
|
||||||
|
@ -126,7 +126,9 @@ class phpbb_content_visibility_set_post_visibility_test extends phpbb_database_t
|
|||||||
$auth = $this->getMock('\phpbb\auth\auth');
|
$auth = $this->getMock('\phpbb\auth\auth');
|
||||||
$user = new \phpbb\user('\phpbb\datetime');
|
$user = new \phpbb\user('\phpbb\datetime');
|
||||||
$config = new phpbb\config\config(array());
|
$config = new phpbb\config\config(array());
|
||||||
$phpbb_dispatcher = $this->getMock('\phpbb\event\dispatcher');
|
$phpbb_dispatcher = $this->getMockBuilder('\phpbb\event\dispatcher')
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
$content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
$content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $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);
|
$content_visibility->set_post_visibility($visibility, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest);
|
||||||
|
@ -90,7 +90,9 @@ class phpbb_content_visibility_set_topic_visibility_test extends phpbb_database_
|
|||||||
$auth = $this->getMock('\phpbb\auth\auth');
|
$auth = $this->getMock('\phpbb\auth\auth');
|
||||||
$user = new \phpbb\user('\phpbb\datetime');
|
$user = new \phpbb\user('\phpbb\datetime');
|
||||||
$config = new phpbb\config\config(array());
|
$config = new phpbb\config\config(array());
|
||||||
$phpbb_dispatcher = $this->getMock('\phpbb\event\dispatcher');
|
$phpbb_dispatcher = $this->getMock('\phpbb\event\dispatcher')
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
$content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
|
$content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $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);
|
$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