diff options
author | Richard Leland <rich@richleland.com> | 2016-05-03 21:12:27 -0400 |
---|---|---|
committer | Richard Leland <rich@richleland.com> | 2016-05-03 21:12:27 -0400 |
commit | d96d825aa138af92628ec7311c05e9659917ba79 (patch) | |
tree | c14aab1ebf1d7a50f9b72dce78679e54dd4942e0 /test | |
parent | 48fcc7b0d1eb204a0a49c50f85dde16fbcb5c6b5 (diff) | |
download | php-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.php | 6 |
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'); } |