From 9a32ca468a320bec9769ed3c29c50b5a1f4459b1 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 8 Jan 2009 08:42:13 +0000 Subject: #8 by sun and most of #drupal: Users can now cancel their accounts. Fixing the 8th issue, almost 8 years later, on January 8th, after working 8 days full-time on it. GREAT WORK :D --- modules/dblog/dblog.test | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'modules/dblog/dblog.test') diff --git a/modules/dblog/dblog.test b/modules/dblog/dblog.test index 902417387..e7b752b1e 100644 --- a/modules/dblog/dblog.test +++ b/modules/dblog/dblog.test @@ -165,7 +165,7 @@ class DBLogTestCase extends DrupalWebTestCase { $this->doNode('page'); $this->doNode('poll'); - // When a user is deleted, any content they created remains but the + // When a user account is canceled, any content they created remains but the // uid = 0. Their blog entry shows as "'s blog" on the home page. Records // in the watchdog table related to that user have the uid set to zero. } @@ -202,8 +202,13 @@ class DBLogTestCase extends DrupalWebTestCase { } $count_before = (isset($ids)) ? count($ids) : 0; $this->assertTrue($count_before > 0, t('DBLog contains @count records for @name', array('@count' => $count_before, '@name' => $user->name))); + + // Login the admin user. + $this->drupalLogin($this->big_user); // Delete user. - user_delete(array(), $user->uid); + // We need to POST here to invoke batch_process() in the internal browser. + $this->drupalPost('user/' . $user->uid . '/cancel', array('user_cancel_method' => 'user_cancel_reassign'), t('Cancel account')); + // Count rows that have uids for the user. $count = db_result(db_query('SELECT COUNT(wid) FROM {watchdog} WHERE uid = %d', $user->uid)); $this->assertTrue($count == 0, t('DBLog contains @count records for @name', array('@count' => $count, '@name' => $user->name))); @@ -225,8 +230,6 @@ class DBLogTestCase extends DrupalWebTestCase { } $this->assertTrue(!isset($ids), t('DBLog contains no records for @name', array('@name' => $user->name))); - // Login the admin user. - $this->drupalLogin($this->big_user); // View the dblog report. $this->drupalGet('admin/reports/dblog'); $this->assertResponse(200); -- cgit v1.2.3