GraphQLExceptionTest::testGetErrors()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Postpay\Tests\Http;
4
5
use PHPUnit\Framework\TestCase;
6
use Postpay\Exceptions\GraphQLException;
7
use Postpay\Http\Request;
8
use Postpay\Http\Response;
9
10
class GraphQLExceptionTest extends TestCase
11
{
12
    public function testGetErrors()
13
    {
14
        $request = new Request('GET');
15
        $errors = [['code' => 'test']];
16
        $body = json_encode([
17
            GraphQLException::ERROR_KEY => $errors,
18
        ]);
19
        $response = new Response($request, 400, [], $body);
20
        $exc = new GraphQLException($response);
21
22
        self::assertSame($errors, $exc->getErrors());
23
    }
24
}
25