Same name in other branches
  1. 7.x-1.x tests/exif_orientation.test \ExifOrientationTest::saveUserPicture()

Uploads a user picture.

1 call to ExifOrientationTest::saveUserPicture()
ExifOrientationTest::testUserPicture dans tests/exif_orientation.test
Test auto rotation of uploaded user profile pictures.

Fichier

tests/exif_orientation.test, line 79

Classe

ExifOrientationTest
@file Tests for exif_orientation.module.

Code

private function saveUserPicture(&$account) {
    $this->drupalLogin($account);
    $edit = array(
        'files[picture_upload]' => drupal_realpath(drupal_get_path('module', 'exif_orientation') . '/tests/rotate90cw.jpg'),
    );
    $this->drupalPost('user/' . $account->uid . '/edit', $edit, t('Save'));
    $account = user_load($account->uid, TRUE);
    $this->assertTrue(isset($account->picture) && isset($account->picture->uri), 'The picture has been uploaded successfully.');
}