Added test against alternate default URL
This commit is contained in:
parent
36d86100f9
commit
74611b9e74
2 changed files with 10 additions and 2 deletions
|
@ -69,7 +69,7 @@ class API_Gravatar
|
||||||
}
|
}
|
||||||
elseif (!in_array($rating, array('g', 'pg', 'r', 'x')))
|
elseif (!in_array($rating, array('g', 'pg', 'r', 'x')))
|
||||||
{
|
{
|
||||||
throw new Exception('Invalid rating perameter, expecting g, pg, r or x.');
|
throw new Exception('Invalid rating parameter, expecting g, pg, r or x.');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,13 +47,21 @@ class API_Gravatar_Test extends PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Exception
|
* @expectedException Exception
|
||||||
* @expectedExceptionMessage Invalid rating perameter, expecting g, pg, r or x.
|
* @expectedExceptionMessage Invalid rating parameter, expecting g, pg, r or x.
|
||||||
*/
|
*/
|
||||||
public function testImgInvalidRating()
|
public function testImgInvalidRating()
|
||||||
{
|
{
|
||||||
API_Gravatar::img('foo@bar.com', 80, 'gravatar', 'sexytime');
|
API_Gravatar::img('foo@bar.com', 80, 'gravatar', 'sexytime');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testURLDefault()
|
||||||
|
{
|
||||||
|
$this->assertEquals(
|
||||||
|
'<img src="http://www.gravatar.com/avatar/f3ada405ce890b6f8204094deb12d8a8?s=80&d=http%253A%252F%252Fexample.org%252Ficon&r=g">',
|
||||||
|
API_Gravatar::img('foo@bar.com', 80, 'http://example.org/icon')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function testImg()
|
public function testImg()
|
||||||
{
|
{
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue