You are here

function UserPictureTestCase::testNoPicture in Drupal 7

File

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

Class

UserPictureTestCase

Code

function testNoPicture() {
  $this
    ->drupalLogin($this->user);

  // Try to upload a file that is not an image for the user picture.
  $not_an_image = current($this
    ->drupalGetTestFiles('html'));
  $this
    ->saveUserPicture($not_an_image);
  $this
    ->assertRaw(t('Only JPEG, PNG and GIF images are allowed.'), 'Non-image files are not accepted.');
}