Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
22 | 18 | public static function assertResponseJsonapiObjectEquals(TestResponse $response, $expected) |
|
23 | { |
||
24 | 18 | if (!\is_array($expected)) { |
|
|
|||
25 | 3 | static::invalidArgument( |
|
26 | 3 | 2, |
|
27 | 3 | 'array', |
|
28 | $expected |
||
29 | ); |
||
30 | } |
||
31 | |||
32 | // Decode JSON response |
||
33 | 15 | $json = $response->json(); |
|
34 | |||
35 | 15 | static::assertHasMember(Members::JSONAPI, $json); |
|
36 | |||
37 | 9 | $jsonapi = $json[Members::JSONAPI]; |
|
38 | |||
39 | 9 | static::assertJsonapiObjectEquals($expected, $jsonapi); |
|
40 | 6 | } |
|
42 |