You are here

protected function UserProtectPermissionsWebTest::testNoEditOwnAccount in User protect 7

Tests edit account without permission "edit own account".

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

File

tests/UserProtectPermissionsWebTest.test, line 188
Contains UserProtectPermissionsWebTest.

Class

UserProtectPermissionsWebTest
Tests permissions.

Code

protected function testNoEditOwnAccount() {

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

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