| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | 1 | public function testFromHttpResponse() |
|
| 8 | { |
||
| 9 | 1 | $httpResp = new \GuzzleHttp\Psr7\Response( |
|
| 10 | 1 | 200, |
|
| 11 | 1 | [], |
|
| 12 | 1 | json_encode([ |
|
| 13 | 1 | 'version' => '1', |
|
| 14 | 'status' => [ |
||
| 15 | 'code' => 1, |
||
| 16 | 'message' => 'message' |
||
| 17 | ], |
||
| 18 | 'error' => true, |
||
| 19 | 'notices' => ['notice'], |
||
| 20 | ]) |
||
| 21 | ); |
||
| 22 | |||
| 23 | 1 | $apiResp = \Promopult\Integra\Response::fromHttpResponse($httpResp); |
|
| 24 | |||
| 25 | 1 | $this->assertEquals('1', $apiResp->getVersion()); |
|
| 26 | 1 | $this->assertEquals(1, $apiResp->getStatusCode()); |
|
| 27 | 1 | $this->assertEquals('message', $apiResp->getStatusMessage()); |
|
| 28 | 1 | $this->assertEquals(true, $apiResp->hasError()); |
|
| 29 | 1 | } |
|
| 31 |