-
Notifications
You must be signed in to change notification settings - Fork 625
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version Bump v5.0.5: Update docs, unit tests and examples to include …
…Sender ID
- Loading branch information
1 parent
62a67d6
commit 5a2ceda
Showing
1 changed file
with
82 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ public static function setUpBeforeClass() | |
|
||
public function testVersion() | ||
{ | ||
$this->assertEquals(SendGrid::VERSION, '5.0.4'); | ||
$this->assertEquals(SendGrid::VERSION, '5.0.5'); | ||
$this->assertEquals(json_decode(file_get_contents(__DIR__ . '/../../composer.json'))->version, SendGrid::VERSION); | ||
} | ||
|
||
|
@@ -775,7 +775,7 @@ public function test_contactdb_recipients_count_get() | |
|
||
public function test_contactdb_recipients_search_get() | ||
{ | ||
$query_params = json_decode('{"%7Bfield_name%7D": "test_string", "{field_name}": "test_string"}'); | ||
$query_params = json_decode('{"{field_name}": "test_string"}'); | ||
$request_headers = array("X-Mock: 200"); | ||
$response = self::$sg->client->contactdb()->recipients()->search()->get(null, $query_params, $request_headers); | ||
$this->assertEquals($response->statusCode(), 200); | ||
|
@@ -1411,6 +1411,86 @@ public function test_scopes_get() | |
$this->assertEquals($response->statusCode(), 200); | ||
} | ||
|
||
public function test_senders_post() | ||
{ | ||
$request_body = json_decode('{ | ||
"address": "123 Elm St.", | ||
"address_2": "Apt. 456", | ||
"city": "Denver", | ||
"country": "United States", | ||
"from": { | ||
"email": "[email protected]", | ||
"name": "Example INC" | ||
}, | ||
"nickname": "My Sender ID", | ||
"reply_to": { | ||
"email": "[email protected]", | ||
"name": "Example INC" | ||
}, | ||
"state": "Colorado", | ||
"zip": "80202" | ||
}'); | ||
$request_headers = array("X-Mock: 201"); | ||
$response = self::$sg->client->senders()->post($request_body, null, $request_headers); | ||
$this->assertEquals($response->statusCode(), 201); | ||
} | ||
|
||
public function test_senders_get() | ||
{ | ||
$request_headers = array("X-Mock: 200"); | ||
$response = self::$sg->client->senders()->get(null, null, $request_headers); | ||
$this->assertEquals($response->statusCode(), 200); | ||
} | ||
|
||
public function test_senders__sender_id__patch() | ||
{ | ||
$request_body = json_decode('{ | ||
"address": "123 Elm St.", | ||
"address_2": "Apt. 456", | ||
"city": "Denver", | ||
"country": "United States", | ||
"from": { | ||
"email": "[email protected]", | ||
"name": "Example INC" | ||
}, | ||
"nickname": "My Sender ID", | ||
"reply_to": { | ||
"email": "[email protected]", | ||
"name": "Example INC" | ||
}, | ||
"state": "Colorado", | ||
"zip": "80202" | ||
}'); | ||
$sender_id = "test_url_param"; | ||
$request_headers = array("X-Mock: 200"); | ||
$response = self::$sg->client->senders()->_($sender_id)->patch($request_body, null, $request_headers); | ||
$this->assertEquals($response->statusCode(), 200); | ||
} | ||
|
||
public function test_senders__sender_id__get() | ||
{ | ||
$sender_id = "test_url_param"; | ||
$request_headers = array("X-Mock: 200"); | ||
$response = self::$sg->client->senders()->_($sender_id)->get(null, null, $request_headers); | ||
$this->assertEquals($response->statusCode(), 200); | ||
} | ||
|
||
public function test_senders__sender_id__delete() | ||
{ | ||
$sender_id = "test_url_param"; | ||
$request_headers = array("X-Mock: 204"); | ||
$response = self::$sg->client->senders()->_($sender_id)->delete(null, null, $request_headers); | ||
$this->assertEquals($response->statusCode(), 204); | ||
} | ||
|
||
public function test_senders__sender_id__resend_verification_post() | ||
{ | ||
$sender_id = "test_url_param"; | ||
$request_headers = array("X-Mock: 204"); | ||
$response = self::$sg->client->senders()->_($sender_id)->resend_verification()->post(null, null, $request_headers); | ||
$this->assertEquals($response->statusCode(), 204); | ||
} | ||
|
||
public function test_stats_get() | ||
{ | ||
$query_params = json_decode('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}'); | ||
|