? sites/default/files
? sites/default/settings.php
Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.186
diff -u -p -r1.186 install.php
--- install.php	22 Jul 2009 04:45:35 -0000	1.186
+++ install.php	24 Jul 2009 06:21:50 -0000
@@ -214,7 +214,8 @@ function install_change_settings($profil
   include_once DRUPAL_ROOT . '/includes/form.inc';
   install_task_list('database');
 
-  $output = drupal_render(drupal_get_form('install_settings_form', $profile, $install_locale, $settings_file, $database));
+  $elements = drupal_get_form('install_settings_form', $profile, $install_locale, $settings_file, $database);
+  $output = drupal_render($elements);
   drupal_set_title(st('Database configuration'));
   print theme('install_page', $output);
   exit;
@@ -434,7 +435,8 @@ function install_select_profile() {
     install_task_list('profile-select');
 
     drupal_set_title(st('Select an installation profile'));
-    print theme('install_page', drupal_render(drupal_get_form('install_select_profile_form', $profiles)));
+    $elements = drupal_get_form('install_select_profile_form', $profiles);
+    print theme('install_page', drupal_render($elements));
     exit;
   }
 }
@@ -559,7 +561,8 @@ function install_select_locale($profilen
 
     drupal_set_title(st('Choose language'));
 
-    print theme('install_page', drupal_render(drupal_get_form('install_select_locale_form', $locales)));
+    $elements = drupal_get_form('install_select_locale_form', $locales);
+    print theme('install_page', drupal_render($elements));
     exit;
   }
 }
@@ -702,7 +705,8 @@ function install_tasks($profile, $task) 
       // got accidentally blown somewhere. Stop it now.
       install_already_done_error();
     }
-    $form = drupal_render(drupal_get_form('install_configure_form', $url));
+    $elements = drupal_get_form('install_configure_form', $url);
+    $form = drupal_render($elements);
 
     if (!variable_get('site_name', FALSE) && !variable_get('site_mail', FALSE)) {
       // Not submitted yet: Prepare to display the form.
Index: update.php
===================================================================
RCS file: /cvs/drupal/drupal/update.php,v
retrieving revision 1.292
diff -u -p -r1.292 update.php
--- update.php	14 Jul 2009 10:22:15 -0000	1.292
+++ update.php	24 Jul 2009 06:21:50 -0000
@@ -195,7 +195,8 @@ function update_do_one($module, $number,
 
 function update_selection_page() {
   drupal_set_title('Drupal database update');
-  $output = drupal_render(drupal_get_form('update_script_selection_form'));
+  $elements = drupal_get_form('update_script_selection_form');
+  $output = drupal_render($elements);
 
   update_task_list('select');
 
Index: includes/locale.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/locale.inc,v
retrieving revision 1.220
diff -u -p -r1.220 locale.inc
--- includes/locale.inc	20 Jul 2009 17:09:36 -0000	1.220
+++ includes/locale.inc	24 Jul 2009 06:21:51 -0000
@@ -564,7 +564,8 @@ function locale_translate_seek_screen() 
   // Add CSS.
   drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css', array('preprocess' => FALSE));
 
-  $output = drupal_render(drupal_get_form('locale_translation_filter_form'));
+  $elements = drupal_get_form('locale_translation_filter_form');
+  $output = drupal_render($elements);
   $output .= _locale_translate_seek();
   return $output;
 }
@@ -804,9 +805,11 @@ function locale_translate_export_screen(
   $output = '';
   // Offer translation export if any language is set up.
   if (count($names)) {
-    $output = drupal_render(drupal_get_form('locale_translate_export_po_form', $names));
+    $elements = drupal_get_form('locale_translate_export_po_form', $names);
+    $output = drupal_render($elements);
   }
-  $output .= drupal_render(drupal_get_form('locale_translate_export_pot_form'));
+  $elements = drupal_get_form('locale_translate_export_pot_form');
+  $output .= drupal_render($elements);
   return $output;
 }
 
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.499
diff -u -p -r1.499 theme.inc
--- includes/theme.inc	15 Jul 2009 17:40:17 -0000	1.499
+++ includes/theme.inc	24 Jul 2009 06:21:51 -0000
@@ -1940,7 +1940,8 @@ function template_preprocess_page(&$vari
   $variables['messages']          = $variables['show_messages'] ? theme('status_messages') : '';
   $variables['main_menu']         = theme_get_setting('toggle_main_menu') ? menu_main_menu() : array();
   $variables['secondary_menu']    = theme_get_setting('toggle_secondary_menu') ? menu_secondary_menu() : array();
-  $variables['search_box']        = (theme_get_setting('toggle_search') ? drupal_render(drupal_get_form('search_theme_form')) : '');
+  $elements = theme_get_setting('toggle_search') ? drupal_get_form('search_theme_form') : '';
+  $variables['search_box']        = (theme_get_setting('toggle_search') ? (drupal_render($elements)) : '');
   $variables['site_name']         = (theme_get_setting('toggle_name') ? filter_xss_admin(variable_get('site_name', 'Drupal')) : '');
   $variables['site_slogan']       = (theme_get_setting('toggle_slogan') ? filter_xss_admin(variable_get('site_slogan', '')) : '');
   $variables['tabs']              = theme('menu_local_tasks');
Index: includes/filetransfer/filetransfer.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/filetransfer/filetransfer.inc,v
retrieving revision 1.2
diff -u -p -r1.2 filetransfer.inc
--- includes/filetransfer/filetransfer.inc	1 Jul 2009 13:44:53 -0000	1.2
+++ includes/filetransfer/filetransfer.inc	24 Jul 2009 06:21:51 -0000
@@ -28,7 +28,8 @@ abstract class FileTransfer {
     $this->jail = $jail;
   }
 
-  abstract static function factory($jail, $settings);
+  static function factory($jail, $settings) {
+  }
 
   /**
    * Implementation of the magic __get() method. If the connection isn't set to
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.742
diff -u -p -r1.742 comment.module
--- modules/comment/comment.module	21 Jul 2009 21:48:24 -0000	1.742
+++ modules/comment/comment.module	24 Jul 2009 06:21:51 -0000
@@ -1686,7 +1686,8 @@ function comment_form(&$form_state, $edi
  *   A string containing the box output.
  */
 function theme_comment_form_box($edit, $title = NULL) {
-  $content = drupal_render(drupal_get_form('comment_form', $edit, $title));
+  $elements = drupal_get_form('comment_form', $edit, $title);
+  $content = drupal_render($elements);
   $output = '<h2 class="title">' . $title . '</h2><div>' . $content . '</div>';
   return $output;
 }
@@ -1753,7 +1754,8 @@ function comment_preview($comment) {
   }
   else {
     $suffix = empty($form['#suffix']) ? '' : $form['#suffix'];
-    $form['#suffix'] = $suffix . drupal_render(node_build($node));
+    $elements = node_build($node);
+    $form['#suffix'] = $suffix . drupal_render($elements);
     $output_below = '';
   }
 
Index: modules/comment/comment.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.pages.inc,v
retrieving revision 1.21
diff -u -p -r1.21 comment.pages.inc
--- modules/comment/comment.pages.inc	1 Jul 2009 20:39:20 -0000	1.21
+++ modules/comment/comment.pages.inc	24 Jul 2009 06:21:51 -0000
@@ -93,7 +93,8 @@ function comment_reply($node, $pid = NUL
       }
       // This is the case where the comment is in response to a node. Display the node.
       elseif (user_access('access content')) {
-        $output .= drupal_render(node_build($node));
+        $elements = node_build($node);
+        $output .= drupal_render($elements);
       }
 
       // Should we show the reply box?
Index: modules/image/image.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/image/image.test,v
retrieving revision 1.5
diff -u -p -r1.5 image.test
--- modules/image/image.test	21 Jul 2009 07:09:46 -0000	1.5
+++ modules/image/image.test	24 Jul 2009 06:21:51 -0000
@@ -50,11 +50,13 @@ class ImageStylesPathAndUrlUnitTest exte
     image_style_save(array('name' => $this->style_name));
 
     // Create the directories for the styles.
-    $status = file_check_directory($d = file_directory_path() . '/styles/' . $this->style_name, FILE_CREATE_DIRECTORY);
+    $d = file_directory_path() . '/styles/' . $this->style_name;
+    $status = file_check_directory($d, FILE_CREATE_DIRECTORY);
     $this->assertNotIdentical(FALSE, $status, t('Created the directory for the generated images for the test style.' ));
 
     // Create a working copy of the file.
-    $file = reset($this->drupalGetTestFiles('image'));
+    $files = $this->drupalGetTestFiles('image');
+    $file = reset($files);
     $this->image_info = image_get_info($file->filepath);
     $this->image_filepath = file_unmanaged_copy($file->filepath, NULL, FILE_EXISTS_RENAME);
     $this->assertNotIdentical(FALSE, $this->image_filepath, t('Created the without generated image file.'));
@@ -232,7 +234,7 @@ class ImageEffectsUnitTest extends Image
  */
 class ImageAdminStylesUnitTest extends DrupalWebTestCase {
 
-  function getInfo() {
+  public static function getInfo() {
     return array(
       'name' => 'Image styles and effects UI configuration',
       'description' => 'Tests creation, deletion, and editing of image styles and effects at the UI level.',
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1085
diff -u -p -r1.1085 node.module
--- modules/node/node.module	20 Jul 2009 22:18:53 -0000	1.1085
+++ modules/node/node.module	24 Jul 2009 06:21:51 -0000
@@ -3100,7 +3100,8 @@ function node_unpublish_by_keyword_actio
  */
 function node_unpublish_by_keyword_action($node, $context) {
   foreach ($context['keywords'] as $keyword) {
-    if (strpos(drupal_render(node_build(clone $node)), $keyword) !== FALSE || strpos($node->title, $keyword) !== FALSE) {
+    $elements = node_build(clone $node);
+    if (strpos(drupal_render($elements), $keyword) !== FALSE || strpos($node->title, $keyword) !== FALSE) {
       $node->status = 0;
       watchdog('action', 'Set @type %title to unpublished.', array('@type' => node_type_get_name($node), '%title' => $node->title));
       break;
Index: modules/node/node.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v
retrieving revision 1.71
diff -u -p -r1.71 node.pages.inc
--- modules/node/node.pages.inc	20 Jul 2009 22:18:53 -0000	1.71
+++ modules/node/node.pages.inc	24 Jul 2009 06:21:51 -0000
@@ -373,8 +373,10 @@ function theme_node_preview($node) {
 
   $preview_trimmed_version = FALSE;
 
-  $trimmed = drupal_render(node_build(clone $node, 'teaser'));
-  $full = drupal_render(node_build($node, 'full'));
+  $elements = node_build(clone $node, 'teaser');
+  $trimmed = drupal_render($elements);
+  $elements = node_build($node, 'full');
+  $full = drupal_render($elements);
 
   // Do we need to preview trimmed version of post as well as full version?
   if ($trimmed != $full) {
Index: modules/openid/openid.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.inc,v
retrieving revision 1.18
diff -u -p -r1.18 openid.inc
--- modules/openid/openid.inc	3 Jun 2009 19:27:21 -0000	1.18
+++ modules/openid/openid.inc	24 Jul 2009 06:21:51 -0000
@@ -73,7 +73,8 @@ function openid_redirect_http($url, $mes
  */
 function openid_redirect($url, $message) {
   $output = '<html><head><title>' . t('OpenID redirect') . "</title></head>\n<body>";
-  $output .= drupal_render(drupal_get_form('openid_redirect_form', $url, $message));
+  $elements = drupal_get_form('openid_redirect_form', $url, $message);
+  $output .= drupal_render($elements);
   $output .= '<script type="text/javascript">document.getElementById("openid-redirect-form").submit();</script>';
   $output .= "</body></html>\n";
   print $output;
Index: modules/openid/openid.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.module,v
retrieving revision 1.51
diff -u -p -r1.51 openid.module
--- modules/openid/openid.module	30 Jun 2009 11:32:08 -0000	1.51
+++ modules/openid/openid.module	24 Jul 2009 06:21:51 -0000
@@ -445,7 +445,7 @@ function openid_authentication($response
     }
     else {
       unset($form_state['values']['response']);
-      $account = user_save('', $form_state['values']);
+      $account = user_save(new stdClass(), $form_state['values']);
       // Terminate if an error occurred during user_save().
       if (!$account) {
         drupal_set_message(t("Error saving user account."), 'error');
Index: modules/poll/poll.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v
retrieving revision 1.301
diff -u -p -r1.301 poll.module
--- modules/poll/poll.module	5 Jul 2009 18:00:09 -0000	1.301
+++ modules/poll/poll.module	24 Jul 2009 06:21:51 -0000
@@ -795,7 +795,8 @@ function theme_poll_choices($form) {
 function template_preprocess_poll_results(&$variables) {
   $variables['links'] = theme('links', $variables['raw_links']);
   if (isset($variables['vote']) && $variables['vote'] > -1 && user_access('cancel own vote')) {
-    $variables['cancel_form'] = drupal_render(drupal_get_form('poll_cancel_form', $variables['nid']));
+    $elements = drupal_get_form('poll_cancel_form', $variables['nid']);
+    $variables['cancel_form'] = drupal_render($elements);
   }
   $variables['title'] = check_plain($variables['raw_title']);
 
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.128
diff -u -p -r1.128 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	22 Jul 2009 04:45:35 -0000	1.128
+++ modules/simpletest/drupal_web_test_case.php	24 Jul 2009 06:21:51 -0000
@@ -851,7 +851,7 @@ class DrupalWebTestCase extends DrupalTe
     $edit['pass']   = user_password();
     $edit['status'] = 1;
 
-    $account = user_save('', $edit);
+    $account = user_save(new stdClass(), $edit);
 
     $this->assertTrue(!empty($account->uid), t('User created with name %name and pass %pass', array('%name' => $edit['name'], '%pass' => $edit['pass'])), t('User login'));
     if (empty($account->uid)) {
Index: modules/simpletest/tests/file.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/file.test,v
retrieving revision 1.36
diff -u -p -r1.36 file.test
--- modules/simpletest/tests/file.test	20 Jul 2009 19:02:38 -0000	1.36
+++ modules/simpletest/tests/file.test	24 Jul 2009 06:21:51 -0000
@@ -283,17 +283,20 @@ class FileSpaceUsedTest extends FileTest
   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 statuses.
+    // The 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 );
+    }
   }
 
   /**
@@ -1597,7 +1600,7 @@ class FileLoadTest extends FileHookTestC
    * 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());
   }
 
@@ -1605,7 +1608,7 @@ class FileLoadTest extends FileHookTestC
    * 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());
   }
 
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.488
diff -u -p -r1.488 taxonomy.module
--- modules/taxonomy/taxonomy.module	20 Jul 2009 18:51:34 -0000	1.488
+++ modules/taxonomy/taxonomy.module	24 Jul 2009 06:21:51 -0000
@@ -1353,7 +1353,8 @@ function taxonomy_vocabulary_load_multip
  *   Results are statically cached.
  */
 function taxonomy_vocabulary_load($vid) {
-  return reset(taxonomy_vocabulary_load_multiple(array($vid), array()));
+  $vocabularies = taxonomy_vocabulary_load_multiple(array($vid), array());
+  return reset($vocabularies);
 }
 
 /**
Index: modules/taxonomy/taxonomy.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v
retrieving revision 1.40
diff -u -p -r1.40 taxonomy.test
--- modules/taxonomy/taxonomy.test	20 Jul 2009 18:51:34 -0000	1.40
+++ modules/taxonomy/taxonomy.test	24 Jul 2009 06:21:51 -0000
@@ -542,7 +542,8 @@ class TaxonomyTermTestCase extends Taxon
     // Create the term to edit.
     $this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->vid . '/add', $edit, t('Save'));
 
-    $term = reset(taxonomy_get_term_by_name($edit['name']));
+    $terms = taxonomy_get_term_by_name($edit['name']);
+    $term = reset($terms);
     $this->assertNotNull($term, t('Term found in database'));
 
     // Submitting a term takes us to the add page; we need the List page.
@@ -708,7 +709,8 @@ class TaxonomyHooksTestCase extends Taxo
       'antonyms' => 'Long',
     );
     $this->drupalPost('admin/structure/taxonomy/' . $vocabulary->vid . '/add', $edit, t('Save'));
-    $term = reset(taxonomy_get_term_by_name($edit['name']));
+    $terms = taxonomy_get_term_by_name($edit['name']);
+    $term = reset($terms);
     $this->assertEqual($term->antonyms[0], $edit['antonyms'], t('Antonyms were loaded into the term object'));
 
     // Update the term with a different antonym.
Index: modules/upload/upload.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.test,v
retrieving revision 1.21
diff -u -p -r1.21 upload.test
--- modules/upload/upload.test	13 Jul 2009 21:51:42 -0000	1.21
+++ modules/upload/upload.test	24 Jul 2009 06:21:51 -0000
@@ -64,7 +64,8 @@ class UploadTestCase extends DrupalWebTe
 
     // Assure that the attachment link appears on teaser view and has correct count.
     $node = node_load($node->nid);
-    $teaser = drupal_render(node_build($node, 'teaser'));
+    $elements = node_build($node, 'teaser');
+    $teaser = drupal_render($elements);
     $this->assertTrue(strpos($teaser, format_plural(2, '1 attachment', '@count attachments')), 'Attachments link found on node teaser.');
 
     // Fetch db record and use fid to rename and delete file.
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1013
diff -u -p -r1.1013 user.module
--- modules/user/user.module	21 Jul 2009 07:27:00 -0000	1.1013
+++ modules/user/user.module	24 Jul 2009 06:21:51 -0000
@@ -1729,7 +1729,7 @@ function user_external_login_register($n
       'status' => 1,
       'access' => REQUEST_TIME
     );
-    $account = user_save('', $userinfo);
+    $account = user_save(new stdClass(), $userinfo);
     // Terminate if an error occurred during user_save().
     if (!$account) {
       drupal_set_message(t("Error saving user account."), 'error');
@@ -2785,7 +2785,7 @@ function user_register_submit($form, &$f
     // Set the user's status because it was not displayed in the form.
     $merge_data['status'] = variable_get('user_register', 1) == 1;
   }
-  $account = user_save('', array_merge($form_state['values'], $merge_data));
+  $account = user_save(new stdClass(), array_merge($form_state['values'], $merge_data));
   // Terminate if an error occurred during user_save().
   if (!$account) {
     drupal_set_message(t("Error saving user account."), 'error');
Index: modules/user/user.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.test,v
retrieving revision 1.47
diff -u -p -r1.47 user.test
--- modules/user/user.test	20 Jul 2009 18:51:35 -0000	1.47
+++ modules/user/user.test	24 Jul 2009 06:21:51 -0000
@@ -159,7 +159,7 @@ class UserValidationTestCase extends Dru
   }
 }
 
-class UserCancelTestCase extends DrupalWebTestCase {
+class UserCancelTestCase extends CommentHelperCase {
   public static function getInfo() {
     return array(
       'name' => 'Cancel account',
@@ -233,7 +233,8 @@ class UserCancelTestCase extends DrupalW
     $bogus_timestamp = $timestamp - 86400 - 60;
     $this->drupalGet("user/$account->uid/cancel/confirm/$bogus_timestamp/" . user_pass_rehash($account->pass, $bogus_timestamp, $account->login));
     $this->assertText(t('You have tried to use an account cancellation link that has expired. Please request a new one using the form below.'), t('Expired cancel account request rejected.'));
-    $this->assertTrue(reset(user_load_multiple(array($account->uid), array('status' => 1))), t('User account was not canceled.'));
+    $users = user_load_multiple(array($account->uid), array('status' => 1));
+    $this->assertTrue(reset($users), t('User account was not canceled.'));
 
     // Confirm user's content has not been altered.
     $test_node = node_load($node->nid, NULL, TRUE);
@@ -387,7 +388,7 @@ class UserCancelTestCase extends DrupalW
 
     // Create comment.
     module_load_include('test', 'comment');
-    $comment = CommentHelperCase::postComment($node, '', $this->randomName(32), FALSE, TRUE);
+    $comment = $this->postComment($node, '', $this->randomName(32), FALSE, TRUE);
     $this->assertTrue(comment_load($comment->id), t('Comment found.'));
 
     // Create a node with two revisions, the initial one belonging to the
@@ -586,7 +587,8 @@ class UserPictureTestCase extends Drupal
 
         // Images are sorted first by size then by name. We need an image
         // bigger than 1 KB so we'll grab the last one.
-        $image = end($this->drupalGetTestFiles('image'));
+        $images = $this->drupalGetTestFiles('image');
+        $image = end($images);
         $info = image_get_info($image->filepath);
 
         // Set new variables: valid dimensions, invalid filesize.
@@ -1057,7 +1059,7 @@ class UserSaveTestCase extends DrupalWeb
       'pass' => user_password(),
       'status' => 1,
     );
-    $user_by_return = user_save('', $user);
+    $user_by_return = user_save(new stdClass(), $user);
     $this->assertTrue($user_by_return, t('Loading user by return of user_save().'));
 
     // Test if created user exists.
