diff options
Diffstat (limited to 'tests/content_visibility')
7 files changed, 24 insertions, 6 deletions
diff --git a/tests/content_visibility/delete_post_test.php b/tests/content_visibility/delete_post_test.php index 8b5a26a6fb..3f15d5a158 100644 --- a/tests/content_visibility/delete_post_test.php +++ b/tests/content_visibility/delete_post_test.php @@ -262,9 +262,10 @@ 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, $config, $db; + global $auth, $cache, $config, $db; $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))); diff --git a/tests/content_visibility/fixtures/set_post_visibility.xml b/tests/content_visibility/fixtures/set_post_visibility.xml index 6fec5c5ad1..722525deaa 100644 --- a/tests/content_visibility/fixtures/set_post_visibility.xml +++ b/tests/content_visibility/fixtures/set_post_visibility.xml @@ -7,6 +7,9 @@ <column>topic_title</column> <column>topic_first_post_id</column> <column>topic_last_post_id</column> + <column>topic_posts_approved</column> + <column>topic_posts_softdeleted</column> + <column>topic_posts_unapproved</column> <row> <value>1</value> <value>1</value> @@ -14,6 +17,9 @@ <value>Approved</value> <value>2</value> <value>2</value> + <value>1</value> + <value>1</value> + <value>1</value> </row> <row> @@ -23,6 +29,9 @@ <value>2 Approved posts</value> <value>5</value> <value>6</value> + <value>1</value> + <value>1</value> + <value>1</value> </row> <row> @@ -32,6 +41,9 @@ <value>Only 1 Approved posts</value> <value>8</value> <value>8</value> + <value>1</value> + <value>0</value> + <value>0</value> </row> </table> <table name="phpbb_posts"> diff --git a/tests/content_visibility/get_forums_visibility_sql_test.php b/tests/content_visibility/get_forums_visibility_sql_test.php index 840f247b14..236b08f74c 100644 --- a/tests/content_visibility/get_forums_visibility_sql_test.php +++ b/tests/content_visibility/get_forums_visibility_sql_test.php @@ -119,8 +119,9 @@ class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_data */ public function test_get_forums_visibility_sql($table, $mode, $forum_ids, $table_alias, $permissions, $expected) { - global $db, $auth; + global $cache, $db, $auth; + $cache = new phpbb_mock_cache; $db = $this->new_dbal(); // Create auth mock diff --git a/tests/content_visibility/get_global_visibility_sql_test.php b/tests/content_visibility/get_global_visibility_sql_test.php index 8b96b3954d..9d320a4ee7 100644 --- a/tests/content_visibility/get_global_visibility_sql_test.php +++ b/tests/content_visibility/get_global_visibility_sql_test.php @@ -119,8 +119,9 @@ class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_data */ public function test_get_global_visibility_sql($table, $mode, $forum_ids, $table_alias, $permissions, $expected) { - global $db, $auth; + global $cache, $db, $auth; + $cache = new phpbb_mock_cache; $db = $this->new_dbal(); // Create auth mock diff --git a/tests/content_visibility/get_visibility_sql_test.php b/tests/content_visibility/get_visibility_sql_test.php index 3c837b2837..4af8c062e7 100644 --- a/tests/content_visibility/get_visibility_sql_test.php +++ b/tests/content_visibility/get_visibility_sql_test.php @@ -66,8 +66,9 @@ class phpbb_content_visibility_get_visibility_sql_test extends phpbb_database_te */ public function test_get_visibility_sql($table, $mode, $forum_id, $table_alias, $permissions, $expected) { - global $db, $auth; + global $cache, $db, $auth; + $cache = new phpbb_mock_cache; $db = $this->new_dbal(); // Create auth mock diff --git a/tests/content_visibility/set_post_visibility_test.php b/tests/content_visibility/set_post_visibility_test.php index d3b237e3e9..8f83457cae 100644 --- a/tests/content_visibility/set_post_visibility_test.php +++ b/tests/content_visibility/set_post_visibility_test.php @@ -115,8 +115,9 @@ class phpbb_content_visibility_set_post_visibility_test extends phpbb_database_t */ public function test_set_post_visibility($visibility, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest, $expected, $expected_topic) { - global $db; + global $cache, $db; + $cache = new phpbb_mock_cache; $db = $this->new_dbal(); phpbb_content_visibility::set_post_visibility($visibility, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest); diff --git a/tests/content_visibility/set_topic_visibility_test.php b/tests/content_visibility/set_topic_visibility_test.php index a1aedc6a5b..31a6b37caa 100644 --- a/tests/content_visibility/set_topic_visibility_test.php +++ b/tests/content_visibility/set_topic_visibility_test.php @@ -79,8 +79,9 @@ class phpbb_content_visibility_set_topic_visibility_test extends phpbb_database_ */ public function test_set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all, $expected_posts, $expected_topic) { - global $db; + global $cache, $db; + $cache = new phpbb_mock_cache; $db = $this->new_dbal(); phpbb_content_visibility::set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all); |