You are here

protected function MonitoringServicesTest::doRequest in Monitoring 7

Do the request.

Parameters

string $action: Action to perform.

array $query: Path query key - value pairs.

Return value

array Decoded json object.

2 calls to MonitoringServicesTest::doRequest()
MonitoringServicesTest::testSensorInfo in test/tests/monitoring.services.test
Test sensor info API calls.
MonitoringServicesTest::testSensorResult in test/tests/monitoring.services.test
Test sensor result API calls.

File

test/tests/monitoring.services.test, line 181
Contains \MonitoringServicesTest.

Class

MonitoringServicesTest
Tests for cron sensor.

Code

protected function doRequest($action, $query = array()) {
  $url = url('monitoring/v1/' . $action, array(
    'absolute' => TRUE,
    'query' => $query,
  ));
  return drupal_json_decode($this
    ->curlExec(array(
    CURLOPT_HTTPGET => TRUE,
    CURLOPT_URL => $url,
    CURLOPT_NOBODY => FALSE,
    CURLOPT_HTTPHEADER => array(
      "Accept: application/json",
    ),
  )));
}