summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzaporylie <jakub@nymedia.no>2016-03-13 09:29:40 +0100
committerzaporylie <jakub@nymedia.no>2016-03-13 09:29:40 +0100
commit487245e0911b2c0dbf63ee81a20061419d1f177e (patch)
treefa80e4db80a51ef2f99045dc74548042abec011c
parentaa6350bf6e10436ba358bd3cbdb1722e5596965c (diff)
downloadphp-sparkpost-487245e0911b2c0dbf63ee81a20061419d1f177e.zip
php-sparkpost-487245e0911b2c0dbf63ee81a20061419d1f177e.tar.gz
php-sparkpost-487245e0911b2c0dbf63ee81a20061419d1f177e.tar.bz2
Add unit test for APIResponseException
-rw-r--r--test/unit/APIResourceExceptionTest.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/unit/APIResourceExceptionTest.php b/test/unit/APIResourceExceptionTest.php
new file mode 100644
index 0000000..5bb4758
--- /dev/null
+++ b/test/unit/APIResourceExceptionTest.php
@@ -0,0 +1,36 @@
+<?php
+namespace SparkPost\Test;
+use SparkPost\APIResponseException;
+
+class APIResourceExceptionTest extends \PHPUnit_Framework_TestCase {
+
+ private $message;
+ private $code;
+ private $description;
+ private $exception;
+
+ /**
+ * (non-PHPdoc)
+ * @before
+ * @see PHPUnit_Framework_TestCase::setUp()
+ */
+ public function setUp() {
+ $this->message = 'Test message';
+ $this->code = 400;
+ $this->description = 'Test description';
+ $this->exception = new APIResponseException(NULL, 0, $this->message, $this->code, $this->description);
+ }
+
+ public function testAPIMessage() {
+ $this->assertEquals($this->message, $this->exception->getAPIMessage());
+ }
+
+ public function testAPICode() {
+ $this->assertEquals($this->code, $this->exception->getAPICode());
+ }
+
+ public function testAPIDescription() {
+ $this->assertEquals($this->description, $this->exception->getAPIDescription());
+ }
+
+}