diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2012-10-05 12:05:22 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2012-10-05 12:05:22 +0200 |
commit | 959525cebe5ea921268a9ab1b62ebc19df9dca9b (patch) | |
tree | e2b7bbe1931d8b5647c84aafe349f0291eb6cfaf /tests | |
parent | b8642d7c8ab7769b8b692409fb6627a4196c93b0 (diff) | |
download | forums-959525cebe5ea921268a9ab1b62ebc19df9dca9b.tar forums-959525cebe5ea921268a9ab1b62ebc19df9dca9b.tar.gz forums-959525cebe5ea921268a9ab1b62ebc19df9dca9b.tar.bz2 forums-959525cebe5ea921268a9ab1b62ebc19df9dca9b.tar.xz forums-959525cebe5ea921268a9ab1b62ebc19df9dca9b.zip |
[feature/soft-delete] Merge functionality of m_approve and m_restore
The problems with having two different permissions are just too big and cause
huge queries, if they are granted differently. Also it's quite hard to decide
what should happen when a moderator has only one permission and the topic has
only posts of the two hidden types. To avoid all this, we merge them so it's a
simple switch: either the user is a moderator, then he can see all posts,
or he is not, then he can only see approved ones.
PHPBB3-9567
Diffstat (limited to 'tests')
3 files changed, 4 insertions, 62 deletions
diff --git a/tests/content_visibility/get_forums_visibility_sql_test.php b/tests/content_visibility/get_forums_visibility_sql_test.php index 6960e43687..840f247b14 100644 --- a/tests/content_visibility/get_forums_visibility_sql_test.php +++ b/tests/content_visibility/get_forums_visibility_sql_test.php @@ -22,7 +22,6 @@ class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_data 'topic', array(1, 2, 3), '', array( array('m_approve', true, array(1 => true, 2 => true, 3 => true)), - array('m_restore', true, array(1 => true, 2 => true, 3 => true)), ), array( array('topic_id' => 1), @@ -41,7 +40,6 @@ class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_data 'topic', array(1, 2), '', array( array('m_approve', true, array(1 => true, 2 => true, 3 => true)), - array('m_restore', true, array(1 => true, 2 => true, 3 => true)), ), array( array('topic_id' => 1), @@ -57,13 +55,12 @@ class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_data 'topic', array(1, 2, 3), '', array( array('m_approve', true, array(2 => true)), - array('m_restore', true, array(1 => true)), ), array( array('topic_id' => 2), - array('topic_id' => 3), array('topic_id' => 4), array('topic_id' => 5), + array('topic_id' => 6), array('topic_id' => 8), ), ), @@ -72,7 +69,6 @@ class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_data 'post', array(1, 2, 3), '', array( array('m_approve', true, array(1 => true, 2 => true, 3 => true)), - array('m_restore', true, array(1 => true, 2 => true, 3 => true)), ), array( array('post_id' => 1), @@ -91,7 +87,6 @@ class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_data 'post', array(1, 2), '', array( array('m_approve', true, array(1 => true, 2 => true, 3 => true)), - array('m_restore', true, array(1 => true, 2 => true, 3 => true)), ), array( array('post_id' => 1), @@ -107,13 +102,12 @@ class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_data 'post', array(1, 2, 3), '', array( array('m_approve', true, array(2 => true)), - array('m_restore', true, array(1 => true)), ), array( array('post_id' => 2), - array('post_id' => 3), array('post_id' => 4), array('post_id' => 5), + array('post_id' => 6), array('post_id' => 8), ), ), diff --git a/tests/content_visibility/get_global_visibility_sql_test.php b/tests/content_visibility/get_global_visibility_sql_test.php index ac8b4225cd..8b96b3954d 100644 --- a/tests/content_visibility/get_global_visibility_sql_test.php +++ b/tests/content_visibility/get_global_visibility_sql_test.php @@ -22,7 +22,6 @@ class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_data 'topic', array(), '', array( array('m_approve', true, array(1 => true, 2 => true, 3 => true)), - array('m_restore', true, array(1 => true, 2 => true, 3 => true)), ), array( array('topic_id' => 1), @@ -41,7 +40,6 @@ class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_data 'topic', array(3), '', array( array('m_approve', true, array(1 => true, 2 => true, 3 => true)), - array('m_restore', true, array(1 => true, 2 => true, 3 => true)), ), array( array('topic_id' => 1), @@ -57,13 +55,12 @@ class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_data 'topic', array(), '', array( array('m_approve', true, array(2 => true)), - array('m_restore', true, array(1 => true)), ), array( array('topic_id' => 2), - array('topic_id' => 3), array('topic_id' => 4), array('topic_id' => 5), + array('topic_id' => 6), array('topic_id' => 8), ), ), @@ -72,7 +69,6 @@ class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_data 'post', array(), '', array( array('m_approve', true, array(1 => true, 2 => true, 3 => true)), - array('m_restore', true, array(1 => true, 2 => true, 3 => true)), ), array( array('post_id' => 1), @@ -91,7 +87,6 @@ class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_data 'post', array(3), '', array( array('m_approve', true, array(1 => true, 2 => true, 3 => true)), - array('m_restore', true, array(1 => true, 2 => true, 3 => true)), ), array( array('post_id' => 1), @@ -107,13 +102,12 @@ class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_data 'post', array(), '', array( array('m_approve', true, array(2 => true)), - array('m_restore', true, array(1 => true)), ), array( array('post_id' => 2), - array('post_id' => 3), array('post_id' => 4), array('post_id' => 5), + array('post_id' => 6), array('post_id' => 8), ), ), diff --git a/tests/content_visibility/get_visibility_sql_test.php b/tests/content_visibility/get_visibility_sql_test.php index 16a38e5f46..3c837b2837 100644 --- a/tests/content_visibility/get_visibility_sql_test.php +++ b/tests/content_visibility/get_visibility_sql_test.php @@ -22,7 +22,6 @@ class phpbb_content_visibility_get_visibility_sql_test extends phpbb_database_te 'post', 1, '', array( array('m_approve', 1, true), - array('m_restore', 1, true), ), array( array('post_id' => 1), @@ -34,28 +33,6 @@ class phpbb_content_visibility_get_visibility_sql_test extends phpbb_database_te 'phpbb_posts', 'post', 1, '', array( - array('m_approve', 1, true), - ), - array( - array('post_id' => 1), - array('post_id' => 2), - ), - ), - array( - 'phpbb_posts', - 'post', 1, '', - array( - array('m_restore', 1, true), - ), - array( - array('post_id' => 2), - array('post_id' => 3), - ), - ), - array( - 'phpbb_posts', - 'post', 1, '', - array( ), array( array('post_id' => 2), @@ -66,7 +43,6 @@ class phpbb_content_visibility_get_visibility_sql_test extends phpbb_database_te 'topic', 1, '', array( array('m_approve', 1, true), - array('m_restore', 1, true), ), array( array('topic_id' => 1), @@ -77,28 +53,6 @@ class phpbb_content_visibility_get_visibility_sql_test extends phpbb_database_te array( 'phpbb_topics', 'topic', 1, '', - array( - array('m_approve', 1, true), - ), - array( - array('topic_id' => 1), - array('topic_id' => 2), - ), - ), - array( - 'phpbb_topics', - 'topic', 1, '', - array( - array('m_restore', 1, true), - ), - array( - array('topic_id' => 2), - array('topic_id' => 3), - ), - ), - array( - 'phpbb_topics', - 'topic', 1, '', array(), array( array('topic_id' => 2), |