You are here

protected function WSClientRestWSTestCase::addSimpletestCurlOptions in Web service client 7

Helper function to add the right cURL headers so that we connect to the simpletest DB.

1 call to WSClientRestWSTestCase::addSimpletestCurlOptions()
WSClientRestWSTestCase::testCRUD in wsclient_examples/wsclient_examples.test
Test the RestWS node service.

File

wsclient_examples/wsclient_examples.test, line 194
Web service client SOAP/REST Tests.

Class

WSClientRestWSTestCase

Code

protected function addSimpletestCurlOptions($service, $account) {
  $curl_options[CURLOPT_HTTPAUTH] = CURLAUTH_BASIC;
  $curl_options[CURLOPT_USERPWD] = $account->name . ':' . $account->pass_raw;
  if (preg_match('/simpletest\\d+/', $this->databasePrefix, $matches)) {
    $curl_options[CURLOPT_USERAGENT] = drupal_generate_test_ua($matches[0]);
  }
  $service->settings['curl options'] = $curl_options;
}