[feature/soft-delete]Fix the rest of unit tests failures

PHPBB3-9567
This commit is contained in:
Joas Schilling 2012-11-10 16:41:43 +01:00
parent 948bfcbe77
commit 51966bd497
7 changed files with 24 additions and 6 deletions

View file

@ -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) 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'; $config['search_type'] = 'phpbb_mock_search';
$cache = new phpbb_mock_cache;
$db = $this->new_dbal(); $db = $this->new_dbal();
set_config_count(null, null, null, new phpbb_config(array('num_posts' => 3, 'num_topics' => 1))); set_config_count(null, null, null, new phpbb_config(array('num_posts' => 3, 'num_topics' => 1)));

View file

@ -7,6 +7,9 @@
<column>topic_title</column> <column>topic_title</column>
<column>topic_first_post_id</column> <column>topic_first_post_id</column>
<column>topic_last_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> <row>
<value>1</value> <value>1</value>
<value>1</value> <value>1</value>
@ -14,6 +17,9 @@
<value>Approved</value> <value>Approved</value>
<value>2</value> <value>2</value>
<value>2</value> <value>2</value>
<value>1</value>
<value>1</value>
<value>1</value>
</row> </row>
<row> <row>
@ -23,6 +29,9 @@
<value>2 Approved posts</value> <value>2 Approved posts</value>
<value>5</value> <value>5</value>
<value>6</value> <value>6</value>
<value>1</value>
<value>1</value>
<value>1</value>
</row> </row>
<row> <row>
@ -32,6 +41,9 @@
<value>Only 1 Approved posts</value> <value>Only 1 Approved posts</value>
<value>8</value> <value>8</value>
<value>8</value> <value>8</value>
<value>1</value>
<value>0</value>
<value>0</value>
</row> </row>
</table> </table>
<table name="phpbb_posts"> <table name="phpbb_posts">

View file

@ -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) 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(); $db = $this->new_dbal();
// Create auth mock // Create auth mock

View file

@ -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) 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(); $db = $this->new_dbal();
// Create auth mock // Create auth mock

View file

@ -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) 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(); $db = $this->new_dbal();
// Create auth mock // Create auth mock

View file

@ -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) 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(); $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); phpbb_content_visibility::set_post_visibility($visibility, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest);

View file

@ -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) 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(); $db = $this->new_dbal();
phpbb_content_visibility::set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all); phpbb_content_visibility::set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all);