You are here

function ClientsTestCase::connectionTestCallbackBasic in Web Service Clients 7.3

Connection test callback.

File

tests/clients.test, line 58
Contains tests for the Clients module.

Class

ClientsTestCase
Test case.

Code

function connectionTestCallbackBasic($method_name) {

  // Remove the method name to get the originally called method's parameters.
  $params = func_get_args();
  array_shift($params);

  // If your usual connection class requires several method calls to connect
  // switch on the $method_name here.
  // Just test we actually get here!
  $this
    ->assertTrue(TRUE, 'The connection test callback is called by the connection.');

  // Test we get the method name and the parameters passed to us.
  $this
    ->assertEqual($method_name, 'fake_connection_method', 'The connection test callback received the name of the method called on the connection.');
  $this
    ->assertEqual($params, array(
    'alpha',
    'beta',
  ), 'The connection test callback received the parameters.');
  return array(
    'remote' => 'data',
  );
}