diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-02-22 17:55:30 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-02-22 17:55:30 +0000 |
commit | 5d658d08481c22b5ef577b39a29cd647438b211f (patch) | |
tree | 74fca69f981d985604b126943aed71bb79d1bbcb /modules/user | |
parent | b3e36d655c831c63c26a710eb3c8bd82ca3b6fc5 (diff) | |
download | brdo-5d658d08481c22b5ef577b39a29cd647438b211f.tar.gz brdo-5d658d08481c22b5ef577b39a29cd647438b211f.tar.bz2 |
- Patch #380064 by c960657: make file_scan_directory() use save property names as file_load().
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']; |