You are here

function UserPictureTestCase::saveUserPicture in Drupal 7

6 calls to UserPictureTestCase::saveUserPicture()
UserPictureTestCase::testNoPicture in modules/user/user.test
UserPictureTestCase::testPictureIsValid in modules/user/user.test
Do the test: Picture is valid (proper size and dimension)
UserPictureTestCase::testWithGDinvalidDimension in modules/user/user.test
Do the test: GD Toolkit is installed Picture has invalid dimension
UserPictureTestCase::testWithGDinvalidSize in modules/user/user.test
Do the test: GD Toolkit is installed Picture has invalid size
UserPictureTestCase::testWithoutGDinvalidDimension in modules/user/user.test
Do the test: GD Toolkit is not installed Picture has invalid size

... See full list

File

modules/user/user.test, line 1541
Tests for user.module.

Class

UserPictureTestCase

Code

function saveUserPicture($image) {
  $edit = array(
    'files[picture_upload]' => drupal_realpath($image->uri),
  );
  $this
    ->drupalPost('user/' . $this->user->uid . '/edit', $edit, t('Save'));

  // Load actual user data from database.
  $account = user_load($this->user->uid, TRUE);
  return isset($account->picture) ? $account->picture->uri : NULL;
}