You are here

public function ServicesEntityTestHelper::retrieve in Services Entity API 7.2

Helper to performa a RESTful retrieve of a resource.

Parameters

string $resource: The resource type to operate on.

string $name: The name of the resource to update

array $args: Any additional args for the querystring.

integer $code: The expected response code (defaults to 200).

1 call to ServicesEntityTestHelper::retrieve()
ServicesEntityNodeResourceTest::testCRUD in tests/services_entity.test
Tests basic CRUD and index actions of a node via the entity_node service.

File

tests/services_entity.test, line 281
Services Entity Tests

Class

ServicesEntityTestHelper
Services Entity Test Helper class.

Code

public function retrieve($resource, $name, $args = array(), $code = 200) {
  $r = $this
    ->servicesGet($this->endpoint->path . '/' . $resource . '/' . $name, $args);
  $this
    ->assertEqual($r['code'], $code, "Received {$code} response code from RETRIEVE {$resource}/{$name} (actual response=" . $r['code'] . ")");
  return $this
    ->unObject($r['body']);
}