You are here

protected function UserProtectPermissionsWebTest::testEditOwnAccount in User protect 7

Tests edit account with permission "edit own account".

Tests if an user with the permission "edit own account" can edit its own account.

File

tests/UserProtectPermissionsWebTest.test, line 172
Contains UserProtectPermissionsWebTest.

Class

UserProtectPermissionsWebTest
Tests permissions.

Code

protected function testEditOwnAccount() {

  // Create an account that may edit its own account.
  $account = $this
    ->drupalCreateUser(array(
    'edit own account',
  ));
  $this
    ->drupalLogin($account);

  // Assert the user can edit its own account.
  $this
    ->drupalGet('user/' . $account->uid . '/edit');
  $this
    ->assertResponse(200, "The user may edit its own account.");
}