summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRichard Leland <rich@richleland.com>2016-05-03 21:12:27 -0400
committerRichard Leland <rich@richleland.com>2016-05-03 21:12:27 -0400
commitd96d825aa138af92628ec7311c05e9659917ba79 (patch)
treec14aab1ebf1d7a50f9b72dce78679e54dd4942e0 /test
parent48fcc7b0d1eb204a0a49c50f85dde16fbcb5c6b5 (diff)
downloadphp-sparkpost-d96d825aa138af92628ec7311c05e9659917ba79.zip
php-sparkpost-d96d825aa138af92628ec7311c05e9659917ba79.tar.gz
php-sparkpost-d96d825aa138af92628ec7311c05e9659917ba79.tar.bz2
Return extended exception data
* Update examples to show available extra exception methods * Resolves #83 * Update 403s to pass back extended exception data Fixes #83
Diffstat (limited to 'test')
-rw-r--r--test/unit/APIResourceTest.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/unit/APIResourceTest.php b/test/unit/APIResourceTest.php
index c2b0c2a..8552815 100644
--- a/test/unit/APIResourceTest.php
+++ b/test/unit/APIResourceTest.php
@@ -131,12 +131,18 @@ class APIResourceTest extends \PHPUnit_Framework_TestCase {
}
public function testAdapter403Exception() {
+ $testBody = [ 'errors' => [
+ [
+ 'message' => 'Forbidden.'
+ ]
+ ]];
try {
$responseMock = Mockery::mock();
$this->sparkPostMock->httpAdapter->shouldReceive('send')->
once()->
andReturn($responseMock);
$responseMock->shouldReceive('getStatusCode')->andReturn(403);
+ $responseMock->shouldReceive('getBody')->andReturn(json_encode($testBody));
$this->resource->get('test');
}