| Conditions | 3 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public static function assertDocumentLinksObjectContains(TestResponse $response, $expected) |
||
| 43 | { |
||
| 44 | if (!\is_array($expected)) { |
||
| 45 | static::invalidArgument( |
||
| 46 | 2, |
||
| 47 | 'array', |
||
| 48 | $expected |
||
| 49 | ); |
||
| 50 | } |
||
| 51 | |||
| 52 | // Decode JSON response |
||
| 53 | $json = $response->json(); |
||
| 54 | |||
| 55 | static::assertHasLinks($json); |
||
| 56 | |||
| 57 | $links = $json[Members::LINKS]; |
||
| 58 | |||
| 59 | foreach ($expected as $name => $value) { |
||
| 60 | static::assertLinksObjectContains($name, $value, $links); |
||
| 61 | } |
||
| 64 |