forked from PCextreme/cloudstack-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClientExceptionTest.php
More file actions
56 lines (47 loc) · 1.1 KB
/
ClientExceptionTest.php
File metadata and controls
56 lines (47 loc) · 1.1 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
namespace PCextreme\Cloudstack\Test\Exception;
use PCextreme\Cloudstack\Exception\ClientException;
class ClientExceptionTest extends \PHPUnit_Framework_TestCase
{
/**
* @var array
*/
protected $result;
/**
* @var ClientException
*/
protected $exception;
protected function setUp()
{
$this->result = [
'errortext' => 'message',
'errorcode' => 404,
];
$this->exception = new ClientException(
$this->result['errortext'],
$this->result['errorcode'],
$this->result
);
}
public function testGetResponseBody()
{
$this->assertEquals(
$this->result,
$this->exception->getResponseBody()
);
}
public function testGetMessage()
{
$this->assertEquals(
$this->result['errortext'],
$this->exception->getMessage()
);
}
public function testGetCode()
{
$this->assertEquals(
$this->result['errorcode'],
$this->exception->getCode()
);
}
}