Commit c6122ee4 authored by john_a's avatar john_a Committed by john_a
Browse files

Issue #2974053 by john_a: InteractionService->getJourney() should have additional input params

parent c4c7ddfc
......@@ -150,15 +150,21 @@ class InteractionService extends MarketingCloudService {
* or
* The key of the journey. Required if not using ID. Prefix the parameter
* with key:. For example, /interactions/key:{key}.
* @param array $params
* Array of extra URI params. Acceptable key/values:
* versionNumber number Required Version number of the journey to
* retrieve.
* extras string A list of additional data to fetch. Available values
* are: all, activities, outcomes and stats. Default is ''.
*
* @return array|bool|null
* The result of the API call, or FALSE on failure.
*
* @see https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/getInteractionById.htm
*/
public function getJourney($id) {
public function getJourney($id, array $params = []) {
$machineName = 'get_journey';
return $this->apiCall($this->moduleName, $machineName, new \stdClass(), ['[id]' => $id]);
return $this->apiCall($this->moduleName, $machineName, new \stdClass(), ['[id]' => $id], $params);
}
/**
......
......@@ -226,6 +226,17 @@ class MarketingCloudInteractionTest extends BrowserTestBase {
],
$result, 'Unexpected request data generated by getJourney()'
);
// Validate service against expected inputs with params.
$result = $this->service
->getJourney('my_uuid', ['extras' => 'all', 'versionNumber' => 2]);
$this->assertNotFalse($result, 'Unable to parse the input data in getJourney().');
$this->assertEquals(
[
'url' => 'https://www.exacttargetapis.com/interaction/v1/interactions/my_uuid?extras=all&versionNumber=2',
'data' => '{}',
],
$result, 'Unexpected request data generated by getJourney()'
);
/*
* Test deleteJourney
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment