You are here

function hook_client_connection_tests_alter in Web Service Clients 7.3

Add or alter connection tests.

This allows site-specific tests to be added to the UI.

Parameters

$tests: The array of tests as returned by hook_clients_connection_type_info(). May be empty.

$connection: The current connection. Use this to determine whether to add any tests; for example, by comparing it to the connection your module is set up to use.

1 invocation of hook_client_connection_tests_alter()
clients_connection_test_form in includes/clients.connection.admin.inc
Form to test a connection.

File

./clients.api.php, line 91
Hooks provided by the Clients module.

Code

function hook_client_connection_tests_alter(&$tests, $connection) {

  // Add a test to all connections of a specific type.
  if ($connection->type == 'foobar') {
    $tests['my_test'] = 'MyTestClass';
  }

  // Add a test to a single connection.
  if ($connection->name == 'bizbax') {
    $tests['my_other_test'] = 'MyOtherTestClass';
  }
}