summaryrefslogtreecommitdiff
path: root/modules/user/user.test
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-06-09 08:11:45 +0000
committerDries Buytaert <dries@buytaert.net>2008-06-09 08:11:45 +0000
commitecb032a239f88ead2087aa98cbcf28522a523922 (patch)
tree042c9109c3fc8149857262be521c25c00337d973 /modules/user/user.test
parent5a9b7c5b713bdd009846d80b3f24caf9948d6fc9 (diff)
downloadbrdo-ecb032a239f88ead2087aa98cbcf28522a523922.tar.gz
brdo-ecb032a239f88ead2087aa98cbcf28522a523922.tar.bz2
- Patch #151902 by MadHarold et al: a better format_size() (and removed some excessive white space).
Diffstat (limited to 'modules/user/user.test')
-rw-r--r--modules/user/user.test20
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/user/user.test b/modules/user/user.test
index fe9c9f59b..2272a17d7 100644
--- a/modules/user/user.test
+++ b/modules/user/user.test
@@ -208,7 +208,7 @@ class UserDeleteTestCase extends DrupalWebTestCase {
class UserPictureTestCase extends DrupalWebTestCase {
protected $user;
protected $_directory_test;
-
+
function getInfo() {
return array(
'name' => t('Upload user picture'),
@@ -216,18 +216,18 @@ class UserPictureTestCase extends DrupalWebTestCase {
'group' => t('User')
);
}
-
+
function setUp() {
parent::setUp();
// Enable user pictures.
variable_set('user_pictures', 1);
-
+
$this->user = $this->drupalCreateUser();
-
+
// Test if directories specified in settings exist in filesystem.
$file_dir = file_directory_path();
$file_check = file_check_directory($file_dir, FILE_CREATE_DIRECTORY, 'file_directory_path');
-
+
$picture_dir = variable_get('user_picture_path', 'pictures');
$picture_path = $file_dir .'/'.$picture_dir;
@@ -267,7 +267,7 @@ class UserPictureTestCase extends DrupalWebTestCase {
variable_set('user_picture_file_size', $test_size);
$pic_path = $this->saveUserPicture($image);
-
+
// check if image is displayed in user's profile page
$this->assertRaw(file_create_url($pic_path), "Image is displayed in user's profile page");
@@ -291,7 +291,7 @@ class UserPictureTestCase extends DrupalWebTestCase {
$image = current($this->drupalGetTestFiles('image'));
$info = image_get_info($image->filename);
-
+
// Set new variables.
$test_dim = ($info['width'] + 10) . 'x' . ($info['height'] + 10);
$test_size = filesize($image->filename);
@@ -324,7 +324,7 @@ class UserPictureTestCase extends DrupalWebTestCase {
$image = current($this->drupalGetTestFiles('image'));
$info = image_get_info($image->filename);
-
+
// Set new variables.
$test_size = floor(filesize($image->filename) / 1000) + 1;
$test_dim = ($info['width'] - 10) . 'x' . ($info['height'] - 10);
@@ -380,7 +380,7 @@ class UserPictureTestCase extends DrupalWebTestCase {
function testPictureIsValid() {
if ($this->_directory_test) {
$this->drupalLogin($this->user);
-
+
$image = current($this->drupalGetTestFiles('image'));
$info = image_get_info($image->filename);
@@ -400,7 +400,7 @@ class UserPictureTestCase extends DrupalWebTestCase {
$this->assertTrue(is_file($pic_path), t('File is located in proper directory'));
}
}
-
+
function saveUserPicture($image) {
$edit = array('files[picture_upload]' => realpath($image->filename));
$this->drupalPost('user/' . $this->user->uid.'/edit', $edit, t('Save'));