You are here

public function ServicesEntityTestHelper::index in Services Entity API 7.2

Helper to performa a RESTful index of a resource.

Parameters

string $resource: The resource type to operate on.

array $args: Any additional args for the querystring.

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

1 call to ServicesEntityTestHelper::index()
ServicesEntityNodeResourceTest::testIndex in tests/services_entity.test
Test index functionality.

File

tests/services_entity.test, line 297
Services Entity Tests

Class

ServicesEntityTestHelper
Services Entity Test Helper class.

Code

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