You are here

function ServicesResourceUsertests::testDeleteSystemUser in Services 7.3

Test delete system user method.

File

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

  // Delete user 0.
  $response = $this
    ->servicesDelete($this->endpoint->path . '/user/0');
  $this
    ->assertTrue(strpos($response['code'], '404') !== FALSE, 'Anonymous user was not deleted.', 'UserResource: Delete');

  // Delete user 1.
  $response = $this
    ->servicesDelete($this->endpoint->path . '/user/1');
  $this
    ->assertTrue(strpos($response['status'], 'The admin user cannot be deleted.') !== FALSE, 'Admin user was not deleted.', 'UserResource: Delete');
}