Merge pull request #1 from geofflancaster/master
Added test cases for the empty string edge casesoauth1test
commit
da5e316c1b
|
@ -41,4 +41,32 @@ class IDPExceptionTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
$this->assertEquals('message: 404: message', (string)$exception);
|
||||
}
|
||||
|
||||
public function testEmptyMessage()
|
||||
{
|
||||
$exception = new IDPException(array('error' => 'error_message', 'message' => ''));
|
||||
// message should be the error text since message isn't specifically defined
|
||||
$this->assertEquals('error_message', $exception->getMessage());
|
||||
}
|
||||
|
||||
public function testNonEmptyMessage()
|
||||
{
|
||||
$exception = new IDPException(array('error' => 'error_message', 'message' => 'message'));
|
||||
// message should be the error text since message isn't specifically defined
|
||||
$this->assertEquals('message', $exception->getMessage());
|
||||
}
|
||||
|
||||
public function testEmptyError()
|
||||
{
|
||||
$exception = new IDPException(array('error' => '', 'message' => 'message'));
|
||||
// message should be the error text since message isn't specifically defined
|
||||
$this->assertEquals('message', $exception->getMessage());
|
||||
}
|
||||
|
||||
public function testEmptyAndMessage()
|
||||
{
|
||||
$exception = new IDPException(array('error' => '', 'message' => ''));
|
||||
// message should be the error text since message isn't specifically defined
|
||||
$this->assertEquals('Unknown Error.', $exception->getMessage());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue