protected function ServicesClientBaseWebTestCase::createSCConnection in Services Client 7.2
Creates services client connection object.
Parameters
array $connection: Overrides that will overwrite default configuration.
Return value
object Connection object.
1 call to ServicesClientBaseWebTestCase::createSCConnection()
- ServicesClientBaseWebTestCase::setUp in tests/
services_client.test - Sets up a Drupal site for running functional and integration tests.
File
- tests/
services_client.test, line 32 - Tests for the Administration menu module.
Class
- ServicesClientBaseWebTestCase
- @file Tests for the Administration menu module.
Code
protected function createSCConnection($connection = array()) {
$name = 'fake_connection';
$defaults = array(
'name' => $name,
'admin_title' => $name,
'version' => 3,
'endpoint' => url('services_client', array(
'absolute' => TRUE,
)),
'config' => array(
'auth' => array(
'plugin' => 'ServicesClientConnectionSessionAuth',
'config' => array(
'username' => 'admin',
'password' => 'admin',
'token' => 1,
),
),
'server' => array(
'plugin' => 'ServicesClientConnectionRestServer',
'config' => array(
'request_formatter' => 'json',
'response_parser' => 'json',
),
),
'request' => array(
'plugin' => 'ServicesClientConnectionCurlRequest',
'config' => array(
'request_timeout' => '30',
'ssl_verifypeer_skip' => 1,
),
),
),
'services_client_id' => 'remote_site',
);
$connection = (object) drupal_array_merge_deep($defaults, $connection);
ctools_export_crud_save('services_client_connection', $connection);
return $connection;
}