-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,18 +30,21 @@ function set_up_inner() { | |
function testadd() { | ||
$raw_result = ''; | ||
|
||
|
||
$call_options = $this->get_call_options($this->list_base_route.'.json', 'POST'); | ||
|
||
$subscriber = array ( | ||
'Email' => '[email protected]', | ||
'Name' => 'Widget Man!', | ||
'CustomFields' => array(array(1,2), array(3,4)) | ||
'CustomFields' => array(array(1,2), array(3,4)), | ||
'ConsentToTrack' => 'yes' | ||
); | ||
|
||
$this->general_test_with_argument('add', $subscriber, $call_options, | ||
$raw_result, $raw_result, 'subscriber was serialised to this'); | ||
} | ||
|
||
|
||
function testupdate() { | ||
$raw_result = ''; | ||
$email = '[email protected]'; | ||
|
@@ -53,7 +56,8 @@ function testupdate() { | |
$subscriber = array ( | ||
'Email' => '[email protected]', | ||
'Name' => 'Widget Man!', | ||
'CustomFields' => array(array(1,2), array(3,4)) | ||
'CustomFields' => array(array(1,2), array(3,4)), | ||
'ConsentToTrack' => 'unchanged', | ||
); | ||
|
||
$transport_result = array ( | ||
|
@@ -86,12 +90,14 @@ function testimport() { | |
array ( | ||
'Email' => '[email protected]', | ||
'Name' => 'Widget Man!', | ||
'CustomFields' => array(array(1,2), array(3,4)) | ||
'CustomFields' => array(array(1,2), array(3,4)), | ||
'ConsentToTrack' => 'no', | ||
), | ||
array ( | ||
'Email' => '[email protected]', | ||
'Name' => 'Widget Man!', | ||
'CustomFields' => array(array(1,2), array(3,4)) | ||
'CustomFields' => array(array(1,2), array(3,4)), | ||
'ConsentToTrack' => 'yes', | ||
) | ||
); | ||
|
||
|
@@ -124,9 +130,10 @@ function testget() { | |
$deserialised = array(1,2,34,5); | ||
$response_code = 200; | ||
$email = '[email protected]'; | ||
$tracking_pref = 'true'; | ||
|
||
$call_options = $this->get_call_options( | ||
$this->list_base_route.'.json?email='.urlencode($email), 'GET'); | ||
$this->list_base_route.'.json?email='.urlencode($email).'&includeTrackingPreference='.$tracking_pref, 'GET'); | ||
|
||
$transport_result = array ( | ||
'code' => $response_code, | ||
|
@@ -138,7 +145,7 @@ function testget() { | |
$this->setup_transport_and_serialisation($transport_result, $call_options, | ||
$deserialised, $raw_result, NULL, NULL, $response_code); | ||
|
||
$result = $this->wrapper->get($email); | ||
$result = $this->wrapper->get($email, true); | ||
|
||
$this->assertIdentical($expected_result, $result); | ||
} | ||
|