aboutsummaryrefslogtreecommitdiffstats
path: root/tests/content_visibility
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-10-06 19:56:52 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-10-06 19:56:52 +0200
commit25804eb8e8b17196116e233b2c8ad3b444cfb5ae (patch)
treeb2a6a333f645f8c537870eb2cafba779ea298633 /tests/content_visibility
parent44005f338e227c10a21270456d181d56749d3f29 (diff)
downloadforums-25804eb8e8b17196116e233b2c8ad3b444cfb5ae.tar
forums-25804eb8e8b17196116e233b2c8ad3b444cfb5ae.tar.gz
forums-25804eb8e8b17196116e233b2c8ad3b444cfb5ae.tar.bz2
forums-25804eb8e8b17196116e233b2c8ad3b444cfb5ae.tar.xz
forums-25804eb8e8b17196116e233b2c8ad3b444cfb5ae.zip
[feature/soft-delete] Add test case for (soft)deleting the only post + fix
PHPBB3-9567
Diffstat (limited to 'tests/content_visibility')
-rw-r--r--tests/content_visibility/delete_post_test.php55
-rw-r--r--tests/content_visibility/fixtures/delete_post.xml35
2 files changed, 90 insertions, 0 deletions
diff --git a/tests/content_visibility/delete_post_test.php b/tests/content_visibility/delete_post_test.php
index c1efdb5d49..0bb7870521 100644
--- a/tests/content_visibility/delete_post_test.php
+++ b/tests/content_visibility/delete_post_test.php
@@ -186,6 +186,61 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
array('forum_posts' => 2, 'forum_topics' => 1, 'forum_topics_real' => 1, 'forum_last_post_id' => 2),
),
),
+
+ array(
+ 2, 2, 4,
+ array(
+ 'topic_first_post_id' => 4,
+ 'topic_last_post_id' => 4,
+ 'topic_replies_real' => 0,
+ 'topic_visibility' => ITEM_APPROVED,
+ 'post_time' => 4,
+ 'post_visibility' => ITEM_APPROVED,
+ 'post_postcount' => true,
+ 'poster_id' => 1,
+ 'post_reported' => false,
+ ),
+ false, 'harddelete',
+ array(
+ ),
+ array(
+ ),
+ array(
+ array('forum_posts' => 0, 'forum_topics' => 0, 'forum_topics_real' => 0, 'forum_last_post_id' => 0),
+ ),
+ ),
+
+ array(
+ 2, 2, 4,
+ array(
+ 'topic_first_post_id' => 4,
+ 'topic_last_post_id' => 4,
+ 'topic_replies_real' => 0,
+ 'topic_visibility' => ITEM_APPROVED,
+ 'post_time' => 4,
+ 'post_visibility' => ITEM_APPROVED,
+ 'post_postcount' => true,
+ 'poster_id' => 1,
+ 'post_reported' => false,
+ ),
+ true, 'soft delete',
+ array(
+ array('post_id' => 4, 'post_visibility' => ITEM_DELETED, 'post_delete_reason' => ''),
+ ),
+ array(
+ array(
+ 'topic_visibility' => ITEM_DELETED,
+ 'topic_first_post_id' => 4,
+ 'topic_last_post_id' => 4,
+ 'topic_replies' => 0,
+ 'topic_replies_real' => 0,
+ 'topic_delete_reason' => 'soft delete',
+ ),
+ ),
+ array(
+ array('forum_posts' => 0, 'forum_topics' => 0, 'forum_topics_real' => 1, 'forum_last_post_id' => 0),
+ ),
+ ),
);
}
diff --git a/tests/content_visibility/fixtures/delete_post.xml b/tests/content_visibility/fixtures/delete_post.xml
index 1140555d67..4799b120b6 100644
--- a/tests/content_visibility/fixtures/delete_post.xml
+++ b/tests/content_visibility/fixtures/delete_post.xml
@@ -18,6 +18,15 @@
<value></value>
<value></value>
</row>
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>4</value>
+ <value></value>
+ <value></value>
+ </row>
</table>
<table name="phpbb_topics">
<column>topic_id</column>
@@ -45,6 +54,19 @@
<value>2</value>
<value>2</value>
</row>
+ <row>
+ <value>2</value>
+ <value>2</value>
+ <value>1</value>
+ <value>Approved</value>
+ <value>4</value>
+ <value>4</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ <value>0</value>
+ <value>0</value>
+ </row>
</table>
<table name="phpbb_posts">
<column>post_id</column>
@@ -93,6 +115,19 @@
<value></value>
<value></value>
</row>
+
+ <row>
+ <value>4</value>
+ <value>1</value>
+ <value>2</value>
+ <value>2</value>
+ <value>1</value>
+ <value>4</value>
+ <value>Approved</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ </row>
</table>
<table name="phpbb_users">
<column>user_id</column>