function ServicesResourceUsertests::testUpdateUserLegacy in Services 6.3
Same name and namespace in other branches
- 7.3 tests/functional/ServicesResourceUserTests.test \ServicesResourceUsertests::testUpdateUserLegacy()
Test update method (Legacy).
TODO: To be removed in future version.
See also
http://drupal.org/node/1083242
File
- tests/
functional/ ServicesResourceUserTests.test, line 281
Class
- ServicesResourceUsertests
- Run test cases for the endpoint with no authentication turned on.
Code
function testUpdateUserLegacy() {
// Create user.
$account = $this
->drupalCreateUser();
// Update mail of the user. Note: roles is required attribute as update
// method does drupal_execute of user_profile_form form.
$updated_account = array(
'uid' => $account->uid,
'name' => $account->name,
'roles' => $account->roles,
'mail' => $this
->randomName() . '@example.com',
);
$response = $this
->servicesPut($this->endpoint->path . '/user/' . $account->uid, array(
'data' => $updated_account,
));
$user_load = user_load($account->uid);
$this
->assertEqual($updated_account['mail'], $user_load->mail, t('User details have been updated successfully'), 'UserResource: Update (Legacy)');
}