| Total Complexity | 2 | 
| Total Lines | 28 | 
| Duplicated Lines | 0 % | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 8 | trait AssertResource  | 
            ||
| 9 | { | 
            ||
| 10 | /**  | 
            ||
| 11 | * Asserts that a resource object correspond to a given model.  | 
            ||
| 12 | *  | 
            ||
| 13 | * @param Model $expected  | 
            ||
| 14 | * @param string $resourceType  | 
            ||
| 15 | * @param array $json  | 
            ||
| 16 | */  | 
            ||
| 17 | public static function assertResourceObjectEqualsModel($expected, $resourceType, $json)  | 
            ||
| 18 |     { | 
            ||
| 19 |         $expected = HelperFactory::create('resource-object', $expected, $resourceType)->toArray(); | 
            ||
| 20 | |||
| 21 | static::assertResourceObjectEquals($expected, $json);  | 
            ||
| 22 | }  | 
            ||
| 23 | |||
| 24 | /**  | 
            ||
| 25 | * Asserts that an array of resource objects correspond to a given collection.  | 
            ||
| 26 | *  | 
            ||
| 27 | * @param Collection $expected  | 
            ||
| 28 | * @param string $resourceType  | 
            ||
| 29 | * @param array $json  | 
            ||
| 30 | */  | 
            ||
| 31 | public static function assertResourceIdentifierCollectionEqualsCollection($expected, $resourceType, $json)  | 
            ||
| 32 |     { | 
            ||
| 33 |         $expected = HelperFactory::create('collection', $expected, $resourceType, true)->toArray(); | 
            ||
| 34 | |||
| 35 | static::assertResourceIdentifierCollectionEquals($expected, $json);  | 
            ||
| 36 | }  | 
            ||
| 38 |