You are here

protected function SensorDataApiTest::processRequest in farmOS 2.x

Process a request.

Parameters

string $method: HTTP method.

\Drupal\Core\Url $url: URL to request.

array $request_options: Request options to apply.

Return value

\GuzzleHttp\Psr7\Response The response.

See also

\Drupal\Tests\jsonapi\Functional\JsonApiRequestTestTrait

2 calls to SensorDataApiTest::processRequest()
SensorDataApiTest::testApiGet in modules/asset/sensor/tests/src/Functional/SensorDataApiTest.php
Test API GET requests.
SensorDataApiTest::testApiPost in modules/asset/sensor/tests/src/Functional/SensorDataApiTest.php
Test API POST requests.

File

modules/asset/sensor/tests/src/Functional/SensorDataApiTest.php, line 168

Class

SensorDataApiTest
Test the Sensor data API.

Namespace

Drupal\Tests\farm_sensor\Functional

Code

protected function processRequest(string $method, Url $url, array $request_options = []) {
  $this
    ->refreshVariables();
  $request_options[RequestOptions::HTTP_ERRORS] = FALSE;
  $client = $this
    ->getSession()
    ->getDriver()
    ->getClient()
    ->getClient();
  return $client
    ->request($method, $url
    ->setAbsolute(TRUE)
    ->toString(), $request_options);
}