Code Duplication    Length = 20-20 lines in 2 locations

tests/Exception/ResponseExceptionTest.php 2 locations

@@ 244-263 (lines=20) @@
241
        $this->assertEquals(299, $exception->getCode());
242
    }
243
244
    public function testClientExceptions()
245
    {
246
        $params = [
247
            'error' => [
248
                'code' => 506,
249
                'message' => 'errmsg',
250
                'error_subcode' => 0,
251
                'type' => 'exception'
252
            ],
253
        ];
254
        $response = new Response($this->request, json_encode($params), 401);
255
        $exception = ResponseException::create($response);
256
        $this->assertInstanceOf(ClientException::class, $exception->getPrevious());
257
        $this->assertEquals(506, $exception->getCode());
258
        $this->assertEquals(0, $exception->getSubErrorCode());
259
        $this->assertEquals('exception', $exception->getErrorType());
260
        $this->assertEquals('errmsg', $exception->getMessage());
261
        $this->assertEquals(json_encode($params), $exception->getRawResponse());
262
        $this->assertEquals(401, $exception->getHttpStatusCode());
263
    }
264
265
    public function testOtherException()
266
    {
@@ 265-284 (lines=20) @@
262
        $this->assertEquals(401, $exception->getHttpStatusCode());
263
    }
264
265
    public function testOtherException()
266
    {
267
        $params = [
268
            'error' => [
269
                'code' => 42,
270
                'message' => 'ship love',
271
                'error_subcode' => 0,
272
                'type' => 'feature'
273
            ],
274
        ];
275
        $response = new Response($this->request, json_encode($params), 200);
276
        $exception = ResponseException::create($response);
277
        $this->assertInstanceOf(OtherException::class, $exception->getPrevious());
278
        $this->assertEquals(42, $exception->getCode());
279
        $this->assertEquals(0, $exception->getSubErrorCode());
280
        $this->assertEquals('feature', $exception->getErrorType());
281
        $this->assertEquals('ship love', $exception->getMessage());
282
        $this->assertEquals(json_encode($params), $exception->getRawResponse());
283
        $this->assertEquals(200, $exception->getHttpStatusCode());
284
    }
285
}
286