This repository has been archived by the owner on Mar 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from alister/master
Default all URLs to https:// by default #44
- Loading branch information
Showing
6 changed files
with
31 additions
and
38 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
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 |
---|---|---|
|
@@ -9,7 +9,13 @@ class GravatarApiTest extends \PHPUnit_Framework_TestCase | |
public function testGravatarUrlWithDefaultOptions() | ||
{ | ||
$api = new GravatarApi(); | ||
$this->assertEquals('http://www.gravatar.com/avatar/0aa61df8e35327ac3b3bc666525e0bee?s=80&r=g', $api->getUrl('[email protected] ')); | ||
$this->assertEquals('https://secure.gravatar.com/avatar/0aa61df8e35327ac3b3bc666525e0bee?s=80&r=g', $api->getUrl('[email protected] ')); | ||
} | ||
|
||
public function testGravatarUrlWithDefaultOptionsNotSecure() | ||
{ | ||
$api = new GravatarApi(); | ||
$this->assertEquals('http://www.gravatar.com/avatar/0aa61df8e35327ac3b3bc666525e0bee?s=80&r=g', $api->getUrl('[email protected]', null, null, null, false)); | ||
} | ||
|
||
public function testGravatarSecureUrlWithDefaultOptions() | ||
|
@@ -21,7 +27,7 @@ public function testGravatarSecureUrlWithDefaultOptions() | |
public function testGravatarUrlWithDefaultImage() | ||
{ | ||
$api = new GravatarApi(); | ||
$this->assertEquals('http://www.gravatar.com/avatar/0aa61df8e35327ac3b3bc666525e0bee?s=80&r=g&d=mm', $api->getUrl('[email protected]', 80, 'g', 'mm')); | ||
$this->assertEquals('https://secure.gravatar.com/avatar/0aa61df8e35327ac3b3bc666525e0bee?s=80&r=g&d=mm', $api->getUrl('[email protected]', 80, 'g', 'mm')); | ||
} | ||
|
||
public function testGravatarSecureProfileUrlWithDefaultOptions() | ||
|
@@ -33,7 +39,7 @@ public function testGravatarSecureProfileUrlWithDefaultOptions() | |
public function testGravatarProfileUrlWithDefaultImage() | ||
{ | ||
$api = new GravatarApi(); | ||
$this->assertEquals('http://www.gravatar.com/0aa61df8e35327ac3b3bc666525e0bee', $api->getProfileUrl('[email protected]')); | ||
$this->assertEquals('https://secure.gravatar.com/0aa61df8e35327ac3b3bc666525e0bee', $api->getProfileUrl('[email protected]')); | ||
} | ||
|
||
public function testGravatarInitializedWithOptions() | ||
|
@@ -43,7 +49,7 @@ public function testGravatarInitializedWithOptions() | |
'default' => 'mm', | ||
)); | ||
|
||
$this->assertEquals('http://www.gravatar.com/avatar/0aa61df8e35327ac3b3bc666525e0bee?s=20&r=g&d=mm', $api->getUrl('[email protected]')); | ||
$this->assertEquals('https://secure.gravatar.com/avatar/0aa61df8e35327ac3b3bc666525e0bee?s=20&r=g&d=mm', $api->getUrl('[email protected]')); | ||
} | ||
|
||
public function testGravatarExists() | ||
|
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 |
---|---|---|
|
@@ -16,20 +16,7 @@ public function setUp() | |
|
||
public function testGetUrlReturnsTheCorrectUrl() | ||
{ | ||
$this->assertEquals('http://www.gravatar.com/avatar/0aa61df8e35327ac3b3bc666525e0bee?s=80&r=g', $this->helper->getUrl('[email protected]')); | ||
} | ||
|
||
public function testGetUrlReturnsTheCorrectSecureUrl() | ||
{ | ||
$this->assertEquals( | ||
'https://secure.gravatar.com/avatar/0aa61df8e35327ac3b3bc666525e0bee?s=80&r=g', | ||
$this->helper->getUrl('[email protected]', null, null, null, true) | ||
); | ||
} | ||
|
||
public function testGetProfileUrlReturnsTheCorrectUrl() | ||
{ | ||
$this->assertEquals('http://www.gravatar.com/0aa61df8e35327ac3b3bc666525e0bee', $this->helper->getProfileUrl('[email protected]')); | ||
$this->assertEquals('https://secure.gravatar.com/avatar/0aa61df8e35327ac3b3bc666525e0bee?s=80&r=g', $this->helper->getUrl('[email protected]')); | ||
} | ||
|
||
public function testGetProfileUrlReturnsTheCorrectSecureUrl() | ||
|
@@ -43,7 +30,7 @@ public function testGetProfileUrlReturnsTheCorrectSecureUrl() | |
public function testGetProfileUrlForHashReturnsTheCorrectUrl() | ||
{ | ||
$this->assertEquals( | ||
'http://www.gravatar.com/0aa61df8e35327ac3b3bc666525e0bee', | ||
'https://secure.gravatar.com/0aa61df8e35327ac3b3bc666525e0bee', | ||
$this->helper->getProfileUrlForHash('0aa61df8e35327ac3b3bc666525e0bee') | ||
); | ||
} | ||
|
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