function ServicesResourceUsertests::testCancelUser in Services 7.3
Test cancel method.
File
- tests/
functional/ ServicesResourceUserTests.test, line 332 - Call the endpoint tests when no authentication is being used.
Class
- ServicesResourceUsertests
- Run test cases for the endpoint with no authentication turned on.
Code
function testCancelUser() {
// Create our privileged user.
$account = $this
->drupalCreateUser(array(
'administer services',
));
// Cancel user.
$response = $this
->servicesPost($this->endpoint->path . '/user/' . $account->uid . '/cancel');
$this
->assertTrue($response['body'], 'Resource has to cancel user has been called successfully.', 'UserResource: Cancel');
$user_load = user_load($account->uid);
$this
->assertFalse($user_load->status, 'User has been canceled successfully.', 'UserResource: Cancel');
}