function UserPictureTestCase::testUserPictureAdminFormValidation in Drupal 7
Tests the admin form validates user picture settings.
File
- modules/
user/ user.test, line 1553 - Tests for user.module.
Class
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.');
}