function UserPictureTestCase::testUserPictureAdminFormValidation

7.x user.test UserPictureTestCase::testUserPictureAdminFormValidation()

Tests the admin form validates user picture settings.

File

drupal-7.x/modules/user/user.test, line 1209
Tests for user.module.

Class

UserPictureTestCase

Code

function testUserPictureAdminFormValidation() {
  $this->drupalLogin($this->drupalCreateUser(array('administer users')));

  // The default values are valid.
  $this->drupalPost('admin/config/people/accounts', array(), t('Save configuration'));
  $this->assertText(t('The configuration options have been saved.'), 'The default values are valid.');

  // The form does not save with an invalid file size.
  $edit = array(
    'user_picture_file_size' => $this->randomName(),
  );
  $this->drupalPost('admin/config/people/accounts', $edit, t('Save configuration'));
  $this->assertNoText(t('The configuration options have been saved.'), 'The form does not save with an invalid file size.');
}