/[drupal]/drupal/modules/dblog/dblog.test
ViewVC logotype

Diff of /drupal/modules/dblog/dblog.test

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.32 by webchick, Sat Jan 9 21:54:00 2010 UTC revision 1.33 by webchick, Mon Feb 8 23:31:45 2010 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: dblog.test,v 1.31 2009/12/23 23:07:16 webchick Exp $  // $Id: dblog.test,v 1.32 2010/01/09 21:54:00 webchick Exp $
3    
4  class DBLogTestCase extends DrupalWebTestCase {  class DBLogTestCase extends DrupalWebTestCase {
5    protected $big_user;    protected $big_user;
# Line 214  class DBLogTestCase extends DrupalWebTes Line 214  class DBLogTestCase extends DrupalWebTes
214      // We need to POST here to invoke batch_process() in the internal browser.      // We need to POST here to invoke batch_process() in the internal browser.
215      $this->drupalPost('user/' . $user->uid . '/cancel', array('user_cancel_method' => 'user_cancel_reassign'), t('Cancel account'));      $this->drupalPost('user/' . $user->uid . '/cancel', array('user_cancel_method' => 'user_cancel_reassign'), t('Cancel account'));
216    
     // Count rows that have uids for the user.  
     $count = db_query('SELECT COUNT(wid) FROM {watchdog} WHERE uid = :uid', array(':uid' => $user->uid))->fetchField();  
     $this->assertTrue($count == 0, t('DBLog contains @count records for @name', array('@count' => $count, '@name' => $user->name)));  
   
     // Count rows in watchdog that previously related to the deleted user.  
     $select = db_select('watchdog');  
     $select->addExpression('COUNT(*)');  
     $select->condition('uid', 0);  
     if ($ids) {  
       $select->condition('wid', $ids, 'IN');  
     }  
     $count_after = $select->execute()->fetchField();  
     $this->assertTrue($count_after == $count_before, t('DBLog contains @count records for @name that now have uid = 0', array('@count' => $count_before, '@name' => $user->name)));  
     unset($ids);  
     // Fetch row ids in watchdog that relate to the user.  
     $result = db_query('SELECT wid FROM {watchdog} WHERE uid = :uid', array(':uid' => $user->uid));  
     foreach ($result as $row) {  
       $ids[] = $row->wid;  
     }  
     $this->assertTrue(!isset($ids), t('DBLog contains no records for @name', array('@name' => $user->name)));  
   
217      // View the dblog report.      // View the dblog report.
218      $this->drupalGet('admin/reports/dblog');      $this->drupalGet('admin/reports/dblog');
219      $this->assertResponse(200);      $this->assertResponse(200);

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

  ViewVC Help
Powered by ViewVC 1.1.6