function ClientsTestCase::testConnectionCall in Web Service Clients 7.3
Test a basic call to the dummy connection.
File
- tests/
clients.test, line 37 - Contains tests for the Clients module.
Class
- ClientsTestCase
- Test case.
Code
function testConnectionCall() {
$this
->assertTrue(TRUE, 'test passes');
// Load the connection.
$connection = clients_connection_load('dummy_connection');
// Set the callback on it.
// Because the entity controller caches the connection, this will remain on
// it when the connection it loaded elsewhere.
$connection
->setCallback(array(
$this,
'connectionTestCallbackBasic',
));
// Make a call to a fake method. This will invoke __call() on the connection
// class, clients_connection_clients_dummy.
$remote_data = $connection
->fake_connection_method('alpha', 'beta');
$this
->assertEqual($remote_data, array(
'remote' => 'data',
), 'The call to the connection returned the mocked remote data.');
}