Skip to content

Commit 487245e

Browse files
committed
Add unit test for APIResponseException
1 parent aa6350b commit 487245e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
namespace SparkPost\Test;
3+
use SparkPost\APIResponseException;
4+
5+
class APIResourceExceptionTest extends \PHPUnit_Framework_TestCase {
6+
7+
private $message;
8+
private $code;
9+
private $description;
10+
private $exception;
11+
12+
/**
13+
* (non-PHPdoc)
14+
* @before
15+
* @see PHPUnit_Framework_TestCase::setUp()
16+
*/
17+
public function setUp() {
18+
$this->message = 'Test message';
19+
$this->code = 400;
20+
$this->description = 'Test description';
21+
$this->exception = new APIResponseException(NULL, 0, $this->message, $this->code, $this->description);
22+
}
23+
24+
public function testAPIMessage() {
25+
$this->assertEquals($this->message, $this->exception->getAPIMessage());
26+
}
27+
28+
public function testAPICode() {
29+
$this->assertEquals($this->code, $this->exception->getAPICode());
30+
}
31+
32+
public function testAPIDescription() {
33+
$this->assertEquals($this->description, $this->exception->getAPIDescription());
34+
}
35+
36+
}

0 commit comments

Comments
 (0)