You are here

public function UuidUserServicesTest::testUserUpdate in Universally Unique IDentifier 7

Tests users Update their own account.

File

uuid_services/uuid_services.user_services.test, line 129
Test the UUID User Services integration.

Class

UuidUserServicesTest
Test the UUID User Services integration.

Code

public function testUserUpdate() {
  $admin_user = $this
    ->drupalCreateUser(array(
    'administer services',
    'administer users',
    'administer permissions',
  ));
  $this
    ->drupalLogin($admin_user);
  $other_user = $this
    ->drupalCreateUser();
  $update = array(
    'uuid' => $other_user->uuid,
    'roles' => array(
      '2' => 'authenticated user',
      '3' => 'administrator',
    ),
    'status' => 1,
    'pass' => $other_user->pass,
  );
  $this
    ->servicesPut($this->endpoint->path . '/user/' . $other_user->uuid, $update);
  $user_after_update = user_load($other_user->uid, TRUE);
  $this
    ->assertTrue(in_array('administrator', $user_after_update->roles), 'Administrator role successfully added');
}