File
- drupal/core/modules/user/lib/Drupal/user/Tests/UserEditedOwnAccountTest.php, line 25
- Definition of Drupal\user\Tests\UserEditedOwnAccountTest.
Class
- UserEditedOwnAccountTest
Namespace
Drupal\user\Tests
Code
function testUserEditedOwnAccount() {
config('user.settings')
->set('register', USER_REGISTER_ADMINISTRATORS_ONLY)
->save();
$account = $this
->drupalCreateUser(array(
'change own username',
));
$this
->drupalLogin($account);
$edit = array();
$edit['name'] = $this
->randomName();
$this
->drupalPost('user/' . $account->uid . '/edit', $edit, t('Save'));
$this
->drupalLogout();
$account->name = $edit['name'];
$this
->drupalLogin($account);
}