| Conditions | 1 |
| Paths | 1 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | 24 | public static function assertFetchedResourceCollectionResponse(TestResponse $response, $expected, bool $strict) |
|
| 25 | { |
||
| 26 | 24 | $response->assertStatus(200); |
|
| 27 | 21 | $response->assertHeader( |
|
| 28 | 21 | HttpHeader::HEADER_NAME, |
|
| 29 | 21 | HttpHeader::MEDIA_TYPE |
|
| 30 | ); |
||
| 31 | |||
| 32 | // Decode JSON response |
||
| 33 | 18 | $json = $response->json(); |
|
| 34 | |||
| 35 | // Checks response structure |
||
| 36 | 18 | static::assertHasValidStructure( |
|
| 37 | 18 | $json, |
|
| 38 | $strict |
||
| 39 | ); |
||
| 40 | |||
| 41 | // Checks data member |
||
| 42 | 15 | static::assertHasData($json); |
|
| 43 | 9 | $data = $json[Members::DATA]; |
|
| 44 | 9 | static::assertResourceCollectionEquals( |
|
| 45 | 9 | $expected, |
|
| 46 | $data |
||
| 47 | ); |
||
| 50 |