Merge pull request #229 from vimishor/issue-185

Added getResponseBody method in IDPException
oauth1test
Ben Ramsey 2015-03-10 14:09:30 -05:00
commit 57ea7ac8f9
2 changed files with 19 additions and 1 deletions

View File

@ -25,6 +25,11 @@ class IDPException extends \Exception
parent::__construct($message, $code);
}
public function getResponseBody()
{
return $this->result;
}
public function getType()
{
$result = 'Exception';

View File

@ -41,4 +41,17 @@ class IDPExceptionTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('message: 404: message', (string)$exception);
}
}
public function testGetResponseBody()
{
$exception = new IDPException(array('error' => 'message', 'code' => 404));
$this->assertEquals(
[
'error' => 'message',
'code' => 404
],
$exception->getResponseBody()
);
}
}