Index: modules/profile/profile.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.test,v
retrieving revision 1.30
diff -u -p -r1.30 profile.test
--- modules/profile/profile.test	30 Aug 2010 00:22:03 -0000	1.30
+++ modules/profile/profile.test	12 Oct 2010 06:01:43 -0000
@@ -160,6 +160,50 @@ class ProfileTestCase extends DrupalWebT
   }
 }
 
+class ProfileTestUserFields extends ProfileTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => "Test that custom fields don't break user pictures.",
+      'description' => "Test that custom fields don't break user pictures.",
+      'group' => 'Profile'
+    );
+  }
+
+  public function testProfileFields() {
+    variable_set('user_pictures', 1);
+
+    $this->drupalLogin($this->normal_user);
+    $user_picture = $this->createUserPicture();
+
+    $this->drupalLogin($this->admin_user);
+    $field = $this->createProfileField('textfield');
+    $this->drupalLogout();
+
+    $this->drupalLogin($this->normal_user);
+    $this->setProfileField($field);
+    $this->drupalGet('user');
+    $this->assertRaw(file_uri_target($user_picture->uri), t("Image is displayed in user's profile page after creating and setting a profile field."));
+  }
+
+  protected function createUserPicture() {
+
+    $image = current($this->drupalGetTestFiles('image'));
+    $info = image_get_info($image->uri);
+    $test_dim = ($info['width'] + 10) . 'x' . ($info['height'] + 10);
+    variable_set('user_picture_dimensions', $test_dim);
+    variable_set('user_picture_file_size', 0);
+
+    $edit = array('files[picture_upload]' => drupal_realpath($image->uri));
+    $this->drupalPost('user/' . $this->normal_user->uid . '/edit', $edit, t('Save'));
+
+    $account = user_load($this->normal_user->uid, TRUE);
+    $pic_path = isset($account->picture) ? $account->picture->uri : NULL;
+    $this->drupalGet('user');
+    $this->assertRaw(file_uri_target($pic_path), t("Image is displayed in user's profile page"));
+    return $pic_path? $account->picture : FALSE;
+  }
+}
+
 class ProfileTestFields extends ProfileTestCase {
   public static function getInfo() {
     return array(
