summaryrefslogtreecommitdiffstats
path: root/test/unit/APIResourceExceptionTest.php
blob: 5bb4758bdca1595aeb0f7eaf3157143527926525 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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());
  }

}