You are here

protected function RestfulCsrfTokenTestCase::getPath in RESTful 7.2

Same name and namespace in other branches
  1. 7 tests/RestfulCsrfTokenTestCase.test \RestfulCsrfTokenTestCase::getPath()

Get the path for the request.

For non "POST" methods, a new node is created.

Parameters

$method: The HTTP method.

Return value

string The path for the request.

1 call to RestfulCsrfTokenTestCase::getPath()
RestfulCsrfTokenTestCase::checkCsrfRequest in tests/RestfulCsrfTokenTestCase.test
Perform requests without, with invalid and with valid CSRF tokens.

File

tests/RestfulCsrfTokenTestCase.test, line 151
Contains RestfulCsrfTokenTestCase

Class

RestfulCsrfTokenTestCase

Code

protected function getPath($method) {
  if ($method == RequestInterface::METHOD_POST) {
    return 'api/v1.0/articles';
  }
  $settings = array(
    'type' => 'article',
    'title' => $this
      ->randomString(),
  );
  $node = $this
    ->drupalCreateNode($settings);
  return 'api/v1.0/articles/' . $node->nid;
}