diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-07-11 15:02:07 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-07-11 15:02:07 +0200 |
commit | 753dc62267118e44b16653113521fe6d0a360720 (patch) | |
tree | 5f96411a594a61781de9247a68d36ae626b964fb /tests/content_visibility/delete_post_test.php | |
parent | 9aed758c1397c31b979f4aca51249c73d21bd6f5 (diff) | |
download | forums-753dc62267118e44b16653113521fe6d0a360720.tar forums-753dc62267118e44b16653113521fe6d0a360720.tar.gz forums-753dc62267118e44b16653113521fe6d0a360720.tar.bz2 forums-753dc62267118e44b16653113521fe6d0a360720.tar.xz forums-753dc62267118e44b16653113521fe6d0a360720.zip |
[ticket/9657] Fix unit tests
PHPBB3-9657
Diffstat (limited to 'tests/content_visibility/delete_post_test.php')
-rw-r--r-- | tests/content_visibility/delete_post_test.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/content_visibility/delete_post_test.php b/tests/content_visibility/delete_post_test.php index e7ab3e3879..6234aac9ad 100644 --- a/tests/content_visibility/delete_post_test.php +++ b/tests/content_visibility/delete_post_test.php @@ -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); |