From 96024e88e9894ce6215805ad389813659259d871 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 23 Sep 2014 09:51:26 +0200 Subject: [PATCH] [ticket/10729] Also test *delete_user on posts and topics PHPBB3-10729 --- tests/functions_user/delete_user_test.php | 28 +++++++++---------- tests/functions_user/fixtures/delete_user.xml | 10 +++++++ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/tests/functions_user/delete_user_test.php b/tests/functions_user/delete_user_test.php index 399dc6a064..d5c78c64ad 100644 --- a/tests/functions_user/delete_user_test.php +++ b/tests/functions_user/delete_user_test.php @@ -205,20 +205,20 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case array( 'retain', array( - array('post_id' => 1, 'post_reported' => 1, 'post_edit_user' => 1), - array('post_id' => 2, 'post_reported' => 1, 'post_edit_user' => 1), - array('post_id' => 3, 'post_reported' => 0, 'post_edit_user' => 1), - array('post_id' => 4, 'post_reported' => 0, 'post_edit_user' => 1), + array('post_id' => 1, 'post_reported' => 1, 'post_edit_user' => 1, 'post_delete_user' => 1), + array('post_id' => 2, 'post_reported' => 1, 'post_edit_user' => 1, 'post_delete_user' => 1), + array('post_id' => 3, 'post_reported' => 0, 'post_edit_user' => 1, 'post_delete_user' => 1), + array('post_id' => 4, 'post_reported' => 0, 'post_edit_user' => 1, 'post_delete_user' => 1), ), array( array('report_id' => 1, 'post_id' => 1, 'user_id' => 1), array('report_id' => 3, 'post_id' => 2, 'user_id' => 1), ), array( - array('topic_id' => 1, 'topic_reported' => 1), - array('topic_id' => 2, 'topic_reported' => 1), - array('topic_id' => 3, 'topic_reported' => 0), - array('topic_id' => 4, 'topic_reported' => 0), + array('topic_id' => 1, 'topic_reported' => 1, 'topic_delete_user' => 1), + array('topic_id' => 2, 'topic_reported' => 1, 'topic_delete_user' => 1), + array('topic_id' => 3, 'topic_reported' => 0, 'topic_delete_user' => 1), + array('topic_id' => 4, 'topic_reported' => 0, 'topic_delete_user' => 1), ), array( array('attach_id' => 1, 'post_msg_id' => 1, 'poster_id' => 1), @@ -229,15 +229,15 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case array( 'remove', array( - array('post_id' => 2, 'post_reported' => 1, 'post_edit_user' => 1), - array('post_id' => 4, 'post_reported' => 0, 'post_edit_user' => 1), + array('post_id' => 2, 'post_reported' => 1, 'post_edit_user' => 1, 'post_delete_user' => 1), + array('post_id' => 4, 'post_reported' => 0, 'post_edit_user' => 1, 'post_delete_user' => 1), ), array( array('report_id' => 3, 'post_id' => 2, 'user_id' => 1), ), array( - array('topic_id' => 2, 'topic_reported' => 1), - array('topic_id' => 4, 'topic_reported' => 0), + array('topic_id' => 2, 'topic_reported' => 1, 'topic_delete_user' => 1), + array('topic_id' => 4, 'topic_reported' => 0, 'topic_delete_user' => 1), ), array( array('attach_id' => 2, 'post_msg_id' => 2, 'poster_id' => 1), @@ -254,7 +254,7 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case { $this->assertFalse(user_delete($mode, 2)); - $sql = 'SELECT post_id, post_reported, post_edit_user + $sql = 'SELECT post_id, post_reported, post_edit_user, post_delete_user FROM ' . POSTS_TABLE . ' ORDER BY post_id ASC'; $result = $this->db->sql_query($sql); @@ -268,7 +268,7 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case $this->assertEquals($expected_reports, $this->db->sql_fetchrowset($result), 'Report table content is mismatching after deleting a user.'); $this->db->sql_freeresult($result); - $sql = 'SELECT topic_id, topic_reported + $sql = 'SELECT topic_id, topic_reported, topic_delete_user FROM ' . TOPICS_TABLE . ' ORDER BY topic_id ASC'; $result = $this->db->sql_query($sql); diff --git a/tests/functions_user/fixtures/delete_user.xml b/tests/functions_user/fixtures/delete_user.xml index 2e09182780..56014b35d1 100644 --- a/tests/functions_user/fixtures/delete_user.xml +++ b/tests/functions_user/fixtures/delete_user.xml @@ -148,6 +148,7 @@ post_id poster_id post_edit_user + post_delete_user post_username topic_id forum_id @@ -159,6 +160,7 @@ 1 2 2 + 2 1 1 @@ -171,6 +173,7 @@ 2 1 1 + 1 Other 2 2 @@ -183,6 +186,7 @@ 3 2 2 + 2 3 3 @@ -195,6 +199,7 @@ 4 1 1 + 1 Other 4 4 @@ -308,6 +313,7 @@ forum_id topic_reported topic_poster + topic_delete_user topic_first_poster_name topic_first_poster_colour topic_last_poster_id @@ -318,6 +324,7 @@ 1 1 2 + 2 00AA00 2 @@ -329,6 +336,7 @@ 2 1 1 + 1 Other 1 @@ -340,6 +348,7 @@ 3 1 2 + 2 00AA00 2 @@ -351,6 +360,7 @@ 4 1 1 + 1 Other 1