From 1149daeeef7858974ef6d1b61dcec1085d4cac88 Mon Sep 17 00:00:00 2001 From: Reginald Costa Date: Fri, 2 Jun 2017 15:36:11 +0200 Subject: [PATCH 1/2] add ListID in Transport config --- src/Transport.php | 5 +++-- tests/TransportTest.php | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Transport.php b/src/Transport.php index cb31026..8e9f892 100644 --- a/src/Transport.php +++ b/src/Transport.php @@ -214,7 +214,7 @@ public function subscribe(Properties $user, $idKey = 'ID') * @param Properties $inputData * @param array $actionProperties */ - public function TriggerCampaignForUserAndActionListItemWithResult($userId, Properties $inputData, array $actionProperties = []) + public function triggerCampaignForUserAndActionListItemWithResult($userId, Properties $inputData, array $actionProperties = []) { $options['Actioncode'] = $actionProperties['Actioncode']; $options['ActionListID'] = $actionProperties['ActionListID']; @@ -227,7 +227,7 @@ public function TriggerCampaignForUserAndActionListItemWithResult($userId, Prope * @param int $userId * @param Properties $inputData */ - public function TriggerCampaignForUserWithResult($userId, Properties $inputData) + public function triggerCampaignForUserWithResult($userId, Properties $inputData) { $options['InputData'] = $inputData; @@ -283,6 +283,7 @@ private function getOptions($userId) { $options = [ 'List' => $this->list, + 'ListID' => $this->list, 'UserID' => $userId, 'GateName' => $this->campaign, ]; diff --git a/tests/TransportTest.php b/tests/TransportTest.php index a2c4cbd..9cff995 100644 --- a/tests/TransportTest.php +++ b/tests/TransportTest.php @@ -175,6 +175,7 @@ protected function buildClientForTriggerCampaign($listId, $listName, $campaign, ->method('TriggerCampaignForUserWithResult') ->with($this->equalTo([ 'List' => $listId, + 'ListID' => $listId, 'UserID' => $userId, 'GateName' => $campaign, 'InputData' => $inputData, @@ -189,6 +190,7 @@ protected function buildClientForTriggerCampaign($listId, $listName, $campaign, $this->equalTo( [ 'List' => $listId, + 'ListID' => $listId, 'UserID' => $userId, 'GateName' => $campaign, 'Actioncode' => $actionProperties['Actioncode'], @@ -224,7 +226,7 @@ public function testTriggerCampaign() $transport = new Transport($client, $listName, $campaign); $transport->setLogger($logger); - $result = $transport->TriggerCampaignForUserWithResult($userId, $inputData); + $result = $transport->triggerCampaignForUserWithResult($userId, $inputData); $this->assertEquals($TriggerCampaignResult, $result); } @@ -254,7 +256,7 @@ public function testTriggerCampaignActionList() $transport = new Transport($client, $listName, $campaign); $transport->setLogger($logger); - $result = $transport->TriggerCampaignForUserAndActionListItemWithResult($userId, $inputData, $actionProperties); + $result = $transport->triggerCampaignForUserAndActionListItemWithResult($userId, $inputData, $actionProperties); $this->assertEquals($TriggerCampaignResult, $result); } @@ -284,7 +286,7 @@ public function testTriggerCampaignWithException() $this->setExpectedException('\Exception'); - $result = $transport->TriggerCampaignForUserWithResult($userId, $inputData); + $result = $transport->triggerCampaignForUserWithResult($userId, $inputData); } protected function buildClientForSubscribe($listId, $listName, $campaign, $user, $userProperties, $GetUserByFilterResponseCode, $CreateUserResponseCode) From 59d79559f2e15c5c3f1496616fe503cf090bf8fc Mon Sep 17 00:00:00 2001 From: Reginald Costa Date: Tue, 13 Jun 2017 15:22:55 +0200 Subject: [PATCH 2/2] fix ActionCode wording --- src/Transport.php | 2 +- tests/TransportTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Transport.php b/src/Transport.php index 8e9f892..a3016a5 100644 --- a/src/Transport.php +++ b/src/Transport.php @@ -216,7 +216,7 @@ public function subscribe(Properties $user, $idKey = 'ID') */ public function triggerCampaignForUserAndActionListItemWithResult($userId, Properties $inputData, array $actionProperties = []) { - $options['Actioncode'] = $actionProperties['Actioncode']; + $options['ActionCode'] = $actionProperties['Actioncode']; $options['ActionListID'] = $actionProperties['ActionListID']; $options['ActionListItemData'] = $inputData; diff --git a/tests/TransportTest.php b/tests/TransportTest.php index 9cff995..7ecef9a 100644 --- a/tests/TransportTest.php +++ b/tests/TransportTest.php @@ -193,7 +193,7 @@ protected function buildClientForTriggerCampaign($listId, $listName, $campaign, 'ListID' => $listId, 'UserID' => $userId, 'GateName' => $campaign, - 'Actioncode' => $actionProperties['Actioncode'], + 'ActionCode' => $actionProperties['Actioncode'], 'ActionListID' => $actionProperties['ActionListID'], 'ActionListItemData' => $inputData, ]