You are here

public function ServicesEntityTestHelper::delete in Services Entity API 7.2

Helper function to perform a RESTful delete of a resource.

Parameters

String $resource: The resource type to operate on.

int $name: The name of the resource to update. (i.e. the ID).

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

1 call to ServicesEntityTestHelper::delete()
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 262
Services Entity Tests

Class

ServicesEntityTestHelper
Services Entity Test Helper class.

Code

public function delete($resource, $name, $code = 200) {

  // Call to parent::servicesDelete
  $r = $this
    ->servicesDelete($this->endpoint->path . '/' . $resource . '/' . $name, NULL);
  $this
    ->assertEqual($r['code'], $code, "Received {$code} response code from DELETE {$resource}/{$name} (actual response=" . $r['code'] . ")");
  return $this
    ->unObject($r['body']);
}