Index: modules/simpletest/tests/file.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/file.test,v
retrieving revision 1.20
diff -u -9 -p -r1.20 file.test
--- modules/simpletest/tests/file.test	10 Jan 2009 06:09:54 -0000	1.20
+++ modules/simpletest/tests/file.test	13 Jan 2009 19:05:53 -0000
@@ -228,29 +228,33 @@ class FileSpaceUsedTest extends FileTest
       'name' => t('File space used tests'),
       'description' => t('Tests the file_space_used() function.'),
       'group' => t('File'),
     );
   }
 
   function setUp() {
     parent::setUp();
 
-    // Create records for a couple of users with different sizes.
-    drupal_write_record('files', $file = array('uid' => 2, 'filesize' => 50, 'status' => FILE_STATUS_PERMANENT));
-    drupal_write_record('files', $file = array('uid' => 2, 'filesize' => 20, 'status' => FILE_STATUS_PERMANENT));
-    drupal_write_record('files', $file = array('uid' => 3, 'filesize' => 100, 'status' => FILE_STATUS_PERMANENT));
-    drupal_write_record('files', $file = array('uid' => 3, 'filesize' => 200, 'status' => FILE_STATUS_PERMANENT));
-
-    // Now create some with other statuses. These values were chosen arbitrarily
-    // for the sole purpose of testing that bitwise operators were used
-    // correctly on the field.
-    drupal_write_record('files', $file = array('uid' => 2, 'filesize' => 1, 'status' => 2 | 8));
-    drupal_write_record('files', $file = array('uid' => 3, 'filesize' => 3, 'status' => 2 | 4));
+    // Create records for a couple of users with different sizes and different
+    // statuses. These status values were chosen arbitrarily for the sole
+    // purpose of testing that bitwise operators were used correctly on the
+    // field.
+    $files = array(
+      array('uid' => 2, 'filesize' => 50, 'status' => FILE_STATUS_PERMANENT),
+      array('uid' => 2, 'filesize' => 20, 'status' => FILE_STATUS_PERMANENT),
+      array('uid' => 3, 'filesize' => 100, 'status' => FILE_STATUS_PERMANENT),
+      array('uid' => 3, 'filesize' => 200, 'status' => FILE_STATUS_PERMANENT),
+      array('uid' => 2, 'filesize' => 1, 'status' => 2 | 8),
+      array('uid' => 3, 'filesize' => 3, 'status' => 2 | 4),
+    );
+    foreach ($files as $file) {
+      drupal_write_record('files', $file );
+    }
   }
 
   /**
    * Test different users with the default status.
    */
   function testUser() {
     $this->assertEqual(file_space_used(2), 70, t("Found the size of the first user's files."));
     $this->assertEqual(file_space_used(3), 300, t("Found the size of the second user's files."));
     $this->assertEqual(file_space_used(), 370, t("Found the size of all user's files."));
@@ -1356,27 +1360,27 @@ class FileLoadTest extends FileHookTestC
   function testLoadMissingFid() {
     $this->assertFalse(file_load(-1), t("Try to load an invalid fid fails."));
     $this->assertFileHooksCalled(array());
   }
 
   /**
    * Try to load a non-existent file by filepath.
    */
   function testLoadMissingFilepath() {
-    $this->assertFalse(reset(file_load_multiple(array(), array('filepath' => 'misc/druplicon.png'))), t("Try to load a file that doesn't exist in the database fails."));
+    $this->assertFalse(file_load_multiple(array(), array('filepath' => 'misc/druplicon.png')), t("Try to load a file that doesn't exist in the database fails."));
     $this->assertFileHooksCalled(array());
   }
 
   /**
    * Try to load a non-existent file by status.
    */
   function testLoadInvalidStatus() {
-    $this->assertFalse(reset(file_load_multiple(array(), array('status' => -99))), t("Trying to load a file with an invalid status fails."));
+    $this->assertFalse(file_load_multiple(array(), array('status' => -99)), t("Trying to load a file with an invalid status fails."));
     $this->assertFileHooksCalled(array());
   }
 
   /**
    * Load a single file and ensure that the correct values are returned.
    */
   function testSingleValues() {
     // Create a new file object from scratch so we know the values.
     $file = array(
Index: modules/user/user.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.test,v
retrieving revision 1.25
diff -u -9 -p -r1.25 user.test
--- modules/user/user.test	8 Jan 2009 08:42:13 -0000	1.25
+++ modules/user/user.test	13 Jan 2009 19:05:53 -0000
@@ -366,21 +366,24 @@ class UserCancelTestCase extends DrupalW
     $account = $this->drupalCreateUser(array('cancel account'));
     $this->drupalLogin($account);
     // Load real user object.
     $account = user_load($account->uid);
 
     // Create a simple node.
     $node = $this->drupalCreateNode(array('uid' => $account->uid));
 
     // Create comment.
-    module_load_include('test', 'comment');
-    $comment = CommentHelperCase::postComment($node, '', $this->randomName(32), TRUE, TRUE);
-    $this->assertTrue(comment_load($comment->id), t('Comment found.'));
+    $edit = array('comment' => $this->randomName(32));
+    $this->drupalGet('comment/reply/' . $node->nid);
+    $this->drupalPost(NULL, $edit, t('Preview'));
+    $this->drupalPost(NULL, $edit, t('Save'));
+    $comment_id = preg_match('/#comment-(\d+)/', $this->getURL(), $match);
+    $this->assertTrue(comment_load($comment_id), t('Comment found.'));
 
     // Create a node with two revisions, the initial one belonging to the
     // cancelling user.
     $revision_node = $this->drupalCreateNode(array('uid' => $account->uid));
     $revision = $revision_node->vid;
     $settings = get_object_vars($revision_node);
     $settings['revision'] = 1;
     $settings['uid'] = 1; // Set new/current revision to someone else.
     $revision_node = $this->drupalCreateNode($settings);
@@ -398,19 +401,19 @@ class UserCancelTestCase extends DrupalW
 
     // Confirm account cancellation request.
     $this->drupalGet("user/$account->uid/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login));
     $this->assertFalse(user_load($account->uid), t('User is not found in the database.'));
 
     // Confirm that user's content has been deleted.
     $this->assertFalse(node_load($node->nid, NULL, TRUE), t('Node of the user has been deleted.'));
     $this->assertFalse(node_load($node->nid, $revision, TRUE), t('Node revision of the user has been deleted.'));
     $this->assertTrue(node_load($revision_node->nid, NULL, TRUE), t("Current revision of the user's node was not deleted."));
-    $this->assertFalse(comment_load($comment->id), t('Comment of the user has been deleted.'));
+    $this->assertFalse(comment_load($comment_id), t('Comment of the user has been deleted.'));
 
     // Confirm that user is logged out.
     $this->assertNoText($account->name, t('Logged out.'));
   }
 
   /**
    * Create an administrative user and delete another user.
    */
   function testUserCancelByAdmin() {
