You are here

class DummyALProfilesHttpClient in Acquia Lift Connector 7

Same name and namespace in other branches
  1. 7.2 acquia_lift_profiles/tests/acquia_lift_profiles.test_classes.inc \DummyALProfilesHttpClient

Classes used for testing.

Hierarchy

Expanded class hierarchy of DummyALProfilesHttpClient

File

acquia_lift_profiles/tests/acquia_lift_profiles.test_classes.inc, line 8

View source
class DummyALProfilesHttpClient extends DummyAcquiaLiftHttpClient {

  /**
   * Prepopulate some dummy data for the API to return.
   *
   * @var array
   */
  protected $data = array(
    'segments' => array(
      'segment1',
      'segment2',
    ),
    'events' => array(),
  );

  /**
   * Implements AcquiaLiftDrupalHttpClientInterface::get().
   */
  public function get($uri = null, $headers = null, array $options = array()) {
    $this
      ->logRequest('get', $uri, $headers, $options);
    $data = array();
    if (strpos($uri, 'segments') !== FALSE) {
      $data = isset($this->data['segments']) ? $this->data['segments'] : array();
    }
    elseif (strpos($uri, 'events') !== FALSE) {
      $data = isset($this->data['events']) ? $this->data['events'] : array();
    }
    return $this
      ->generateDummyResponse($data);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DummyAcquiaLiftHttpClient::$breakageType protected property The type of breakage to simulate, i.e. client or server side.
DummyAcquiaLiftHttpClient::$broken protected property Whether or not this http client should return 500 errors.
DummyAcquiaLiftHttpClient::$requests_received protected static property Stores all requests that have been received.
DummyAcquiaLiftHttpClient::clearLoggedRequests public static function
DummyAcquiaLiftHttpClient::delete public function Implements AcquiaLiftDrupalHttpClientInterface::delete(). Overrides AcquiaLiftDrupalHttpClientInterface::delete
DummyAcquiaLiftHttpClient::generateDummyResponse protected function Generates a dummy response based on the passed in data.
DummyAcquiaLiftHttpClient::getDataForURI protected function Returns the expected data array for a given uri.
DummyAcquiaLiftHttpClient::getLoggedRequests public static function Returns all requests that have been made to this client.
DummyAcquiaLiftHttpClient::logRequest protected function Logs the request internally.
DummyAcquiaLiftHttpClient::post public function Implements AcquiaLiftDrupalHttpClientInterface::post(). Overrides AcquiaLiftDrupalHttpClientInterface::post
DummyAcquiaLiftHttpClient::put public function Implements AcquiaLiftDrupalHttpClientInterface::put(). Overrides AcquiaLiftDrupalHttpClientInterface::put
DummyAcquiaLiftHttpClient::__construct public function Constructor
DummyALProfilesHttpClient::$data protected property Prepopulate some dummy data for the API to return. Overrides DummyAcquiaLiftHttpClient::$data
DummyALProfilesHttpClient::get public function Implements AcquiaLiftDrupalHttpClientInterface::get(). Overrides DummyAcquiaLiftHttpClient::get