| Total Complexity | 2 |
| Total Lines | 15 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | trait AssertFetchedRelationships |
||
| 9 | { |
||
| 10 | public static function assertRelationshipsLinks(TestResponse $response, $expected, $path = null) |
||
| 11 | { |
||
| 12 | // Decode JSON response |
||
| 13 | $json = $response->json(); |
||
| 14 | |||
| 15 | if (!is_null($path)) { |
||
| 16 | $json = static::getJsonFromPath($json, $path); |
||
| 17 | } |
||
| 18 | |||
| 19 | static::assertHasLinks($json); |
||
| 20 | $links = $json['links']; |
||
| 21 | static::assertContainsOnlyAllowedMembers(['self', 'related'], $links); |
||
| 22 | AssertArray::assertArraySubset($expected, $links); |
||
| 23 | } |
||
| 25 |