You are here

function ServicesResourceUsertests::testCancelAdmin in Services 7.3

Test cant cancel user 1.

File

tests/functional/ServicesResourceUserTests.test, line 349
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 testCancelAdmin() {

  // Cancel user.
  $response = $this
    ->servicesPost($this->endpoint->path . '/user/1/cancel');
  $this
    ->assertEqual($response['code'], 403, 'Services successfully blocked cancel of user 1', 'UserResource: Cancel');
  $user_load = user_load(1);
  $this
    ->assertTrue(!empty($user_load), 'User 1 still exits and has not deleted, as this is not allowed.', 'UserResource: Cancel');
}