mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[feature/soft-delete]Fix the rest of unit tests failures
PHPBB3-9567
This commit is contained in:
parent
948bfcbe77
commit
51966bd497
7 changed files with 24 additions and 6 deletions
|
@ -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)));
|
||||||
|
|
||||||
|
|
|
@ -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">
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue