Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade sendgrid/php-http-client #295

Merged
merged 5 commits into from
Sep 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ sendgrid-php.php
composer.phar
.editorconfig
test.php
.idea/
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"keywords": ["SendGrid", "sendgrid", "email", "send", "grid"],
"require": {
"php": ">=5.6",
"sendgrid/php-http-client": "3.1.0"
"sendgrid/php-http-client": "~3.4"
},
"require-dev": {
"phpunit/phpunit": "4.*",
Expand Down
15 changes: 8 additions & 7 deletions test/unit/SendGridTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,21 @@ public function testVersion()

public function testSendGrid()
{
$apiKey = "SENDGRID_API_KEY";
$apiKey = 'SENDGRID_API_KEY';
$sg = new SendGrid($apiKey);
$headers = array(
'Authorization: Bearer '.$apiKey,
'User-Agent: sendgrid/' . $sg->version . ';php',
'Accept: application/json'
);
$this->assertEquals($sg->client->host, "https://api.sendgrid.com");
$this->assertEquals($sg->client->request_headers, $headers);
$this->assertEquals($sg->client->version, "/v3");
);

$apiKey = "SENDGRID_API_KEY";
$this->assertEquals($sg->client->getHost(), 'https://api.sendgrid.com');
$this->assertEquals($sg->client->getHeaders(), $headers);
$this->assertEquals($sg->client->getVersion(), '/v3');

$apiKey = 'SENDGRID_API_KEY';
$sg2 = new SendGrid($apiKey, array('host' => 'https://api.test.com'));
$this->assertEquals($sg2->client->host, "https://api.test.com");
$this->assertEquals($sg2->client->getHost(), 'https://api.test.com');
}

public function test_access_settings_activity_get()
Expand Down