? sites/default/files
? sites/default/private
? sites/default/settings.php
Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.202
diff -u -p -r1.202 install.php
--- install.php	25 Aug 2009 21:53:46 -0000	1.202
+++ install.php	29 Aug 2009 01:15:29 -0000
@@ -1027,7 +1027,8 @@ function install_select_profile(&$instal
       if ($install_state['interactive']) {
         include_once DRUPAL_ROOT . '/includes/form.inc';
         drupal_set_title(st('Select an installation profile'));
-        return drupal_render(drupal_get_form('install_select_profile_form', $install_state['profiles']));
+        $elements = drupal_get_form('install_select_profile_form', $install_state['profiles']);
+        return drupal_render($elements);
       }
       else {
         throw new Exception(install_no_profile_error());
@@ -1196,7 +1197,8 @@ function install_select_locale(&$install
       if ($install_state['interactive']) {
         drupal_set_title(st('Choose language'));
         include_once DRUPAL_ROOT . '/includes/form.inc';
-        return drupal_render(drupal_get_form('install_select_locale_form', $locales));
+        $elements = drupal_get_form('install_select_locale_form', $locales);
+        return drupal_render($elements);
       }
       else {
         throw new Exception(st('Sorry, you must select a language to continue the installation.'));
Index: update.php
===================================================================
RCS file: /cvs/drupal/drupal/update.php,v
retrieving revision 1.301
diff -u -p -r1.301 update.php
--- update.php	25 Aug 2009 21:53:47 -0000	1.301
+++ update.php	29 Aug 2009 01:15:29 -0000
@@ -28,7 +28,8 @@ define('MAINTENANCE_MODE', 'update');
 
 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.226
diff -u -p -r1.226 locale.inc
--- includes/locale.inc	22 Aug 2009 14:34:17 -0000	1.226
+++ includes/locale.inc	29 Aug 2009 01:15:29 -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.516
diff -u -p -r1.516 theme.inc
--- includes/theme.inc	26 Aug 2009 10:53:45 -0000	1.516
+++ includes/theme.inc	29 Aug 2009 01:15:30 -0000
@@ -2062,7 +2062,8 @@ function template_preprocess_page(&$vari
   $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['action_links']      = menu_local_actions();
-  $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') : array();
+  $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.4
diff -u -p -r1.4 filetransfer.inc
--- includes/filetransfer/filetransfer.inc	28 Aug 2009 07:51:55 -0000	1.4
+++ includes/filetransfer/filetransfer.inc	29 Aug 2009 01:15:30 -0000
@@ -24,7 +24,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/image/image.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/image/image.test,v
retrieving revision 1.8
diff -u -p -r1.8 image.test
--- modules/image/image.test	26 Aug 2009 03:20:39 -0000	1.8
+++ modules/image/image.test	29 Aug 2009 01:15:30 -0000
@@ -51,11 +51,13 @@ class ImageStylesPathAndUrlUnitTest exte
     image_style_save(array('name' => $this->style_name));
 
     // Create the directories for the styles.
-    $status = file_prepare_directory($d = file_directory_path() . '/styles/' . $this->style_name, FILE_CREATE_DIRECTORY);
+    $d = file_directory_path() . '/styles/' . $this->style_name;
+    $status = file_prepare_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->uri);
     $this->image_filepath = file_unmanaged_copy($file->uri, NULL, FILE_EXISTS_RENAME);
     $this->assertNotIdentical(FALSE, $this->image_filepath, t('Created the without generated image file.'));
@@ -234,7 +236,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.',
@@ -262,7 +264,8 @@ class ImageAdminStylesUnitTest extends D
     // First, we need to make sure we have an image in our testing
     // file directory. Copy over an image on the first run.
     if (!isset($file_path)) {
-      $file = reset($this->drupalGetTestFiles('image'));
+      $files = $this->drupalGetTestFiles('image');
+      $file = reset($files);
       $file_path = file_unmanaged_copy($file->uri);
     }
 
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1112
diff -u -p -r1.1112 node.module
--- modules/node/node.module	25 Aug 2009 21:53:47 -0000	1.1112
+++ modules/node/node.module	29 Aug 2009 01:15:30 -0000
@@ -3091,7 +3091,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.78
diff -u -p -r1.78 node.pages.inc
--- modules/node/node.pages.inc	25 Aug 2009 10:27:14 -0000	1.78
+++ modules/node/node.pages.inc	29 Aug 2009 01:15:30 -0000
@@ -378,8 +378,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	29 Aug 2009 01:15:30 -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.56
diff -u -p -r1.56 openid.module
--- modules/openid/openid.module	24 Aug 2009 00:14:21 -0000	1.56
+++ modules/openid/openid.module	29 Aug 2009 01:15:30 -0000
@@ -448,7 +448,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.310
diff -u -p -r1.310 poll.module
--- modules/poll/poll.module	24 Aug 2009 00:14:21 -0000	1.310
+++ modules/poll/poll.module	29 Aug 2009 01:15:30 -0000
@@ -804,7 +804,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.145
diff -u -p -r1.145 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	27 Aug 2009 20:25:28 -0000	1.145
+++ modules/simpletest/drupal_web_test_case.php	29 Aug 2009 01:15:30 -0000
@@ -864,7 +864,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.40
diff -u -p -r1.40 file.test
--- modules/simpletest/tests/file.test	19 Aug 2009 08:38:09 -0000	1.40
+++ modules/simpletest/tests/file.test	29 Aug 2009 01:15:30 -0000
@@ -287,17 +287,20 @@ class FileSpaceUsedTest extends FileTest
   function setUp() {
     parent::setUp();
 
-    // Create records for a couple of users with different sizes.
-    drupal_write_record('file', $file = array('uid' => 2, 'uri' => 'public://example1.txt', 'filesize' => 50, 'status' => FILE_STATUS_PERMANENT));
-    drupal_write_record('file', $file = array('uid' => 2, 'uri' => 'public://example2.txt', 'filesize' => 20, 'status' => FILE_STATUS_PERMANENT));
-    drupal_write_record('file', $file = array('uid' => 3, 'uri' => 'public://example3.txt', 'filesize' => 100, 'status' => FILE_STATUS_PERMANENT));
-    drupal_write_record('file', $file = array('uid' => 3, 'uri' => 'public://example4.txt', '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('file', $file = array('uid' => 2, 'uri' => 'public://example5.txt', 'filesize' => 1, 'status' => 2 | 8));
-    drupal_write_record('file', $file = array('uid' => 3, 'uri' => 'public://example6.txt', '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, 'uri' => 'public://example1.txt', 'filesize' => 50, 'status' => FILE_STATUS_PERMANENT),
+      array('uid' => 2, 'uri' => 'public://example2.txt', 'filesize' => 20, 'status' => FILE_STATUS_PERMANENT),
+      array('uid' => 3, 'uri' => 'public://example3.txt', 'filesize' => 100, 'status' => FILE_STATUS_PERMANENT),
+      array('uid' => 3, 'uri' => 'public://example4.txt', 'filesize' => 200, 'status' => FILE_STATUS_PERMANENT),
+      array('uid' => 2, 'uri' => 'public://example5.txt', 'filesize' => 1, 'status' => 2 | 8),
+      array('uid' => 3, 'uri' => 'public://example6.txt', 'filesize' => 3, 'status' => 2 | 4),
+    );
+    foreach ($files as $file) {
+      drupal_write_record('file', $file);
+    }
   }
 
   /**
@@ -1578,7 +1581,8 @@ class FileLoadTest extends FileHookTestC
    * Try to load a non-existent file by URI.
    */
   function testLoadMissingFilepath() {
-    $this->assertFalse(reset(file_load_multiple(array(), array('uri' => 'foobar://misc/druplicon.png'))), t("Try to load a file that doesn't exist in the database fails."));
+    $files = file_load_multiple(array(), array('uri' => 'foobar://misc/druplicon.png'));
+    $this->assertFalse(reset($files), t("Try to load a file that doesn't exist in the database fails."));
     $this->assertFileHooksCalled(array());
   }
 
@@ -1586,7 +1590,8 @@ 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."));
+    $files = file_load_multiple(array(), array('status' => -99));
+    $this->assertFalse(reset($files), t("Trying to load a file with an invalid status fails."));
     $this->assertFileHooksCalled(array());
   }
 
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.779
diff -u -p -r1.779 system.module
--- modules/system/system.module	28 Aug 2009 16:23:05 -0000	1.779
+++ modules/system/system.module	29 Aug 2009 01:15:30 -0000
@@ -1853,6 +1853,7 @@ function _system_get_module_data() {
 
   // Include the install profile in modules that are loaded.
   $profile = drupal_get_profile();
+  $modules[$profile] = (object) array();
   $modules[$profile]->name = $profile;
   $modules[$profile]->uri = 'profiles/' . $profile . '/' . $profile . '.profile';
   $modules[$profile]->filename = $profile . '.profile';
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.507
diff -u -p -r1.507 taxonomy.module
--- modules/taxonomy/taxonomy.module	27 Aug 2009 20:48:31 -0000	1.507
+++ modules/taxonomy/taxonomy.module	29 Aug 2009 01:15:30 -0000
@@ -1264,7 +1264,7 @@ class TaxonomyTermController extends Dru
     }
   }
 
-  protected function cacheGet($ids) {
+  protected function cacheGet($ids, $conditions = array()) {
     $terms = parent::cacheGet($ids);
     // Name matching is case insensitive, note that with some collations
     // LOWER() and drupal_strtolower() may return different results.
@@ -1379,7 +1379,8 @@ function taxonomy_vocabulary_load_multip
  *   Results are statically cached.
  */
 function taxonomy_vocabulary_load($vid) {
-  return reset(taxonomy_vocabulary_load_multiple(array($vid)));
+  $vocabularies = taxonomy_vocabulary_load_multiple(array($vid));
+  return reset($vocabularies);
 }
 
 /**
Index: modules/taxonomy/taxonomy.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v
retrieving revision 1.46
diff -u -p -r1.46 taxonomy.test
--- modules/taxonomy/taxonomy.test	25 Aug 2009 21:53:48 -0000	1.46
+++ modules/taxonomy/taxonomy.test	29 Aug 2009 01:15:30 -0000
@@ -519,7 +519,8 @@ class TaxonomyTermTestCase extends Taxon
     // Create the term to edit.
     $this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->vid . '/list/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.
@@ -685,7 +686,8 @@ class TaxonomyHooksTestCase extends Taxo
       'antonym' => 'Long',
     );
     $this->drupalPost('admin/structure/taxonomy/' . $vocabulary->vid . '/list/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->antonym, $edit['antonym'], t('Antonym was loaded into the term object'));
 
     // Update the term with a different antonym.
Index: modules/trigger/trigger.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.module,v
retrieving revision 1.46
diff -u -p -r1.46 trigger.module
--- modules/trigger/trigger.module	24 Aug 2009 00:14:22 -0000	1.46
+++ modules/trigger/trigger.module	29 Aug 2009 01:15:30 -0000
@@ -423,7 +423,8 @@ function trigger_user_cancel($edit, $acc
  * Implement hook_user_view().
  */
 function trigger_user_view($account) {
-  _trigger_user('view', $edit = NULL, $account, NULL);
+  $edit = NULL;
+  _trigger_user('view', $edit, $account, NULL);
 }
 
 /**
Index: modules/upload/upload.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.test,v
retrieving revision 1.25
diff -u -p -r1.25 upload.test
--- modules/upload/upload.test	22 Aug 2009 19:30:41 -0000	1.25
+++ modules/upload/upload.test	29 Aug 2009 01:15:30 -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.1033
diff -u -p -r1.1033 user.module
--- modules/user/user.module	28 Aug 2009 06:42:54 -0000	1.1033
+++ modules/user/user.module	29 Aug 2009 01:15:30 -0000
@@ -1787,7 +1787,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');
@@ -2949,7 +2949,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.57
diff -u -p -r1.57 user.test
--- modules/user/user.test	25 Aug 2009 02:48:16 -0000	1.57
+++ modules/user/user.test	29 Aug 2009 01:15:30 -0000
@@ -276,7 +276,7 @@ class UserLoginTestCase extends DrupalWe
   }
 }
 
-class UserCancelTestCase extends DrupalWebTestCase {
+class UserCancelTestCase extends CommentHelperCase {
   public static function getInfo() {
     return array(
       'name' => 'Cancel account',
@@ -350,7 +350,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);
@@ -504,7 +505,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
@@ -704,7 +705,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->uri);
 
         // Set new variables: valid dimensions, invalid filesize.
@@ -1175,7 +1177,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.
