Commit 962a7783 authored by webchick's avatar webchick
Browse files

#371327 by quicksketch: Fix user picture rendering (with fixed tests).

parent c591f456
...@@ -767,7 +767,7 @@ function user_elements() { ...@@ -767,7 +767,7 @@ function user_elements() {
*/ */
function user_user_view(&$edit, &$account, $category = NULL) { function user_user_view(&$edit, &$account, $category = NULL) {
$account->content['user_picture'] = array( $account->content['user_picture'] = array(
'#value' => theme('user_picture', $account), '#markup' => theme('user_picture', $account),
'#weight' => -10, '#weight' => -10,
); );
if (!isset($account->content['summary'])) { if (!isset($account->content['summary'])) {
......
...@@ -548,7 +548,7 @@ class UserPictureTestCase extends DrupalWebTestCase { ...@@ -548,7 +548,7 @@ class UserPictureTestCase extends DrupalWebTestCase {
$text = t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', array('%dimensions' => $test_dim)); $text = t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', array('%dimensions' => $test_dim));
$this->assertRaw($text, t('Image was resized.')); $this->assertRaw($text, t('Image was resized.'));
$alt = t("@user's picture", array('@user' => $this->user->name)); $alt = t("@user's picture", array('@user' => $this->user->name));
$this->assertRaw(theme('image', $pic_path, $alt, $alt, '', FALSE), t("Image is displayed in user's profile page")); $this->assertRaw(theme('image', $pic_path, $alt, $alt, '', FALSE), t("Image is displayed in user's edit page"));
// Check if file is located in proper directory. // Check if file is located in proper directory.
$this->assertTrue(is_file($pic_path), t("File is located in proper directory")); $this->assertTrue(is_file($pic_path), t("File is located in proper directory"));
...@@ -678,10 +678,11 @@ class UserPictureTestCase extends DrupalWebTestCase { ...@@ -678,10 +678,11 @@ class UserPictureTestCase extends DrupalWebTestCase {
$pic_path = $this->saveUserPicture($image); $pic_path = $this->saveUserPicture($image);
// check if image is displayed in user's profile page // Check if image is displayed in user's profile page.
$this->drupalGet('user');
$this->assertRaw($pic_path, t("Image is displayed in user's profile page")); $this->assertRaw($pic_path, t("Image is displayed in user's profile page"));
// check if file is located in proper directory // Check if file is located in proper directory.
$this->assertTrue(is_file($pic_path), t('File is located in proper directory')); $this->assertTrue(is_file($pic_path), t('File is located in proper directory'));
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment