1 user.test UserPictureTestCase::testUserPictureAdminFormValidation()

Tests the admin form validates user picture settings.

File

core/modules/user/tests/user.test, line 1267
Tests for user.module.

Class

UserPictureTestCase

Code

function testUserPictureAdminFormValidation() {
  $this->backdropLogin($this->backdropCreateUser(array('administer account settings')));

  // The default values are valid.
  $this->backdropPost('admin/config/people/settings', 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->backdropPost('admin/config/people/settings', $edit, t('Save configuration'));
  $this->assertNoText(t('The configuration options have been saved.'), 'The form does not save with an invalid file size.');
}