Same name and namespace in other branches
  1. 8.x-1.x tests/exif_orientation.test \ExifOrientationTest::saveUserPicture() 1 comment

Uploads a user picture.

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

File

tests/exif_orientation.test, line 79

Class

ExifOrientationTest
@file Tests for <a href="/en/work/drupal-api/exif_orientation/exif_orientation.module/7.x-1.x" title="Module file for EXIF Orientation" class="local">exif_orientation.module</a>.

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.');
}