class DummyALProfilesHttpClient in Acquia Lift Connector 7
Same name and namespace in other branches
- 7.2 acquia_lift_profiles/tests/acquia_lift_profiles.test_classes.inc \DummyALProfilesHttpClient
Classes used for testing.
Hierarchy
- class \DummyAcquiaLiftHttpClient implements AcquiaLiftDrupalHttpClientInterface
- class \DummyALProfilesHttpClient
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);
}
}