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 #40 from alister/feature/profiles
Gravatar Profile URL support
- Loading branch information
Showing
7 changed files
with
129 additions
and
0 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 |
---|---|---|
|
@@ -24,6 +24,18 @@ public function testGravatarUrlWithDefaultImage() | |
$this->assertEquals('http://www.gravatar.com/avatar/0aa61df8e35327ac3b3bc666525e0bee?s=80&r=g&d=mm', $api->getUrl('[email protected]', 80, 'g', 'mm')); | ||
} | ||
|
||
public function testGravatarSecureProfileUrlWithDefaultOptions() | ||
{ | ||
$api = new GravatarApi(); | ||
$this->assertEquals('https://secure.gravatar.com/0aa61df8e35327ac3b3bc666525e0bee', $api->getProfileUrl('[email protected]', true)); | ||
} | ||
|
||
public function testGravatarProfileUrlWithDefaultImage() | ||
{ | ||
$api = new GravatarApi(); | ||
$this->assertEquals('http://www.gravatar.com/0aa61df8e35327ac3b3bc666525e0bee', $api->getProfileUrl('[email protected]')); | ||
} | ||
|
||
public function testGravatarInitializedWithOptions() | ||
{ | ||
$api = new GravatarApi(array( | ||
|
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 |
---|---|---|
|
@@ -27,6 +27,35 @@ public function testGetUrlReturnsTheCorrectSecureUrl() | |
); | ||
} | ||
|
||
public function testGetProfileUrlReturnsTheCorrectUrl() | ||
{ | ||
$this->assertEquals('http://www.gravatar.com/0aa61df8e35327ac3b3bc666525e0bee', $this->helper->getProfileUrl('[email protected]')); | ||
} | ||
|
||
public function testGetProfileUrlReturnsTheCorrectSecureUrl() | ||
{ | ||
$this->assertEquals( | ||
'https://secure.gravatar.com/0aa61df8e35327ac3b3bc666525e0bee', | ||
$this->helper->getProfileUrl('[email protected]', true) | ||
); | ||
} | ||
|
||
public function testGetProfileUrlForHashReturnsTheCorrectUrl() | ||
{ | ||
$this->assertEquals( | ||
'http://www.gravatar.com/0aa61df8e35327ac3b3bc666525e0bee', | ||
$this->helper->getProfileUrlForHash('0aa61df8e35327ac3b3bc666525e0bee') | ||
); | ||
} | ||
|
||
public function testGetProfileUrlForHashReturnsTheCorrectSecureUrl() | ||
{ | ||
$this->assertEquals( | ||
'https://secure.gravatar.com/0aa61df8e35327ac3b3bc666525e0bee', | ||
$this->helper->getProfileUrlForHash('0aa61df8e35327ac3b3bc666525e0bee', true) | ||
); | ||
} | ||
|
||
public function testCheckForAvatarExistance() | ||
{ | ||
$this->assertTrue($this->helper->exists('[email protected]')); | ||
|
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 |
---|---|---|
|
@@ -36,6 +36,8 @@ public function testProxyMethods() | |
$this->extension->getUrl('[email protected]'); | ||
$this->extension->exists('[email protected]'); | ||
$this->extension->getUrlForHash(md5('[email protected]')); | ||
$this->extension->getProfileUrl('[email protected]'); | ||
$this->extension->getProfileUrlForHash(md5('[email protected]')); | ||
} | ||
|
||
public function testName() | ||
|
@@ -50,6 +52,8 @@ public function testFunctions() | |
$expectedNames = array( | ||
'gravatar', | ||
'gravatar_hash', | ||
'gravatar_profile', | ||
'gravatar_profile_hash', | ||
'gravatar_exists', | ||
); | ||
|
||
|
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