You are here

public static function AcquiaLiftAPI::setTestInstance in Acquia Lift Connector 7

Same name and namespace in other branches
  1. 7.2 includes/AcquiaLiftAPI.inc \AcquiaLiftAPI::setTestInstance()

Returns an AcquiaLiftAPI instance with dummy creds and a dummy HttpClient.

This is used during simpletest web tests.

16 calls to AcquiaLiftAPI::setTestInstance()
AcquiaLiftAPI::getInstance in includes/acquia_lift.classes.inc
Singleton factory method.
AcquiaLiftWebTestAgentAdmin::testPauseAgents in tests/acquia_lift.test
Tests that agents are paused when they need to be paused.
AcquiaLiftWebTestBase::createTestAgent in tests/acquia_lift.test
Help function to create and test queue creation of Personalize Agent
AcquiaLiftWebTestFundamentals::testAcquiaLiftQueue in tests/acquia_lift.test
AcquiaLiftWebTestFundamentals::testBatchSyncOperations in tests/acquia_lift.test
Tests the function that gathers operations for syncing of agents and their components to Lift.

... See full list

File

includes/acquia_lift.classes.inc, line 133
Provides an agent type for Acquia Lift

Class

AcquiaLiftAPI
@file Provides an agent type for Acquia Lift

Code

public static function setTestInstance($broken_http_client = FALSE, $simulate_client_side_breakage = FALSE) {
  module_load_include('inc', 'acquia_lift', 'tests/acquia_lift.test_classes');
  self::$instance = new self('test-api-key', 'test-admin-key', 'test-owner-code', 'http://api.example.com');

  // This method is only ever called within the context of a simpletest web
  // test, so the call to variable_get() is ok here.
  $test_data = variable_get('acquia_lift_web_test_data', array());
  self::$instance
    ->setHttpClient(new DummyAcquiaLiftHttpClient($broken_http_client, $test_data, $simulate_client_side_breakage));
  self::$instance
    ->setLogger(new AcquiaLiftTestLogger(FALSE));
}