You are here

function ServicesResourceUsertests::testRetrieveUser in Services 7.3

Same name and namespace in other branches
  1. 6.3 tests/functional/ServicesResourceUserTests.test \ServicesResourceUsertests::testRetrieveUser()

Test retrieve method.

File

tests/functional/ServicesResourceUserTests.test, line 180
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 testRetrieveUser() {
  $response = $this
    ->servicesGET($this->endpoint->path . '/user/' . $this->privileged_user->uid);
  $account = $response['body'];
  $users_are_the_same = $account->name == $this->privileged_user->name && ($account->mail = $this->privileged_user->mail) && ($account->roles = $this->privileged_user->roles);
  $this
    ->assertTrue($users_are_the_same, 'Retrieved user is the same as created.', 'UserResource: Retrieve');
}