diff options
Diffstat (limited to 'modules/user')
-rw-r--r-- | modules/user/user.test | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/modules/user/user.test b/modules/user/user.test index 89c534a26..228be6b81 100644 --- a/modules/user/user.test +++ b/modules/user/user.test @@ -535,7 +535,7 @@ class UserPictureTestCase extends DrupalWebTestCase { $this->drupalLogin($this->user); $image = current($this->drupalGetTestFiles('image')); - $info = image_get_info($image->filename); + $info = image_get_info($image->filepath); // Set new variables: invalid dimensions, valid filesize (0 = no limit). $test_dim = ($info['width'] - 10) . 'x' . ($info['height'] - 10); @@ -569,7 +569,7 @@ class UserPictureTestCase extends DrupalWebTestCase { $this->drupalLogin($this->user); $image = current($this->drupalGetTestFiles('image')); - $info = image_get_info($image->filename); + $info = image_get_info($image->filepath); // Set new variables: valid dimensions, invalid filesize. $test_dim = ($info['width'] + 10) . 'x' . ($info['height'] + 10); @@ -580,9 +580,9 @@ class UserPictureTestCase extends DrupalWebTestCase { $pic_path = $this->saveUserPicture($image); // Test that the upload failed and that the correct reason was cited. - $text = t('The specified file %filename could not be uploaded.', array('%filename' => $image->basename)); + $text = t('The specified file %filename could not be uploaded.', array('%filename' => $image->filename)); $this->assertRaw($text, t('Upload failed.')); - $text = t('The file is %filesize exceeding the maximum file size of %maxsize.', array('%filesize' => format_size(filesize($image->filename)), '%maxsize' => format_size($test_size * 1024))); + $text = t('The file is %filesize exceeding the maximum file size of %maxsize.', array('%filesize' => format_size(filesize($image->filepath)), '%maxsize' => format_size($test_size * 1024))); $this->assertRaw($text, t('File size cited as reason for failure.')); // Check if file is not uploaded. @@ -604,7 +604,7 @@ class UserPictureTestCase extends DrupalWebTestCase { $this->drupalLogin($this->user); $image = current($this->drupalGetTestFiles('image')); - $info = image_get_info($image->filename); + $info = image_get_info($image->filepath); // Set new variables: invalid dimensions, valid filesize (0 = no limit). $test_dim = ($info['width'] - 10) . 'x' . ($info['height'] - 10); @@ -614,7 +614,7 @@ class UserPictureTestCase extends DrupalWebTestCase { $pic_path = $this->saveUserPicture($image); // Test that the upload failed and that the correct reason was cited. - $text = t('The specified file %filename could not be uploaded.', array('%filename' => $image->basename)); + $text = t('The specified file %filename could not be uploaded.', array('%filename' => $image->filename)); $this->assertRaw($text, t('Upload failed.')); $text = t('The image is too large; the maximum dimensions are %dimensions pixels.', array('%dimensions' => $test_dim)); $this->assertRaw($text, t('Checking response on invalid image (dimensions).')); @@ -637,7 +637,7 @@ class UserPictureTestCase extends DrupalWebTestCase { $this->drupalLogin($this->user); $image = current($this->drupalGetTestFiles('image')); - $info = image_get_info($image->filename); + $info = image_get_info($image->filepath); // Set new variables: valid dimensions, invalid filesize. $test_dim = ($info['width'] + 10) . 'x' . ($info['height'] + 10); @@ -648,9 +648,9 @@ class UserPictureTestCase extends DrupalWebTestCase { $pic_path = $this->saveUserPicture($image); // Test that the upload failed and that the correct reason was cited. - $text = t('The specified file %filename could not be uploaded.', array('%filename' => $image->basename)); + $text = t('The specified file %filename could not be uploaded.', array('%filename' => $image->filename)); $this->assertRaw($text, t('Upload failed.')); - $text = t('The file is %filesize exceeding the maximum file size of %maxsize.', array('%filesize' => format_size(filesize($image->filename)), '%maxsize' => format_size($test_size * 1024))); + $text = t('The file is %filesize exceeding the maximum file size of %maxsize.', array('%filesize' => format_size(filesize($image->filepath)), '%maxsize' => format_size($test_size * 1024))); $this->assertRaw($text, t('File size cited as reason for failure.')); // Check if file is not uploaded. @@ -669,7 +669,7 @@ class UserPictureTestCase extends DrupalWebTestCase { $this->drupalLogin($this->user); $image = current($this->drupalGetTestFiles('image')); - $info = image_get_info($image->filename); + $info = image_get_info($image->filepath); // Set new variables: valid dimensions, valid filesize (0 = no limit). $test_dim = ($info['width'] + 10) . 'x' . ($info['height'] + 10); @@ -688,10 +688,10 @@ class UserPictureTestCase extends DrupalWebTestCase { } function saveUserPicture($image) { - $edit = array('files[picture_upload]' => realpath($image->filename)); + $edit = array('files[picture_upload]' => realpath($image->filepath)); $this->drupalPost('user/' . $this->user->uid.'/edit', $edit, t('Save')); - $img_info = image_get_info($image->filename); + $img_info = image_get_info($image->filepath); $picture_dir = variable_get('user_picture_path', 'pictures'); $pic_path = file_directory_path() . '/' . $picture_dir . '/picture-' . $this->user->uid . '.' . $img_info['extension']; |