File tree Expand file tree Collapse file tree 1 file changed +4
-26
lines changed Expand file tree Collapse file tree 1 file changed +4
-26
lines changed Original file line number Diff line number Diff line change 33namespace Test \Feature ;
44
55use Ark4ne \JsonApi \Resources \JsonApiCollection ;
6+ use Ark4ne \JsonApi \Resources \Skeleton ;
67use Test \app \Http \Resources \CommentResource ;
78use Test \app \Http \Resources \PostResource ;
89use Test \app \Http \Resources \UserResource ;
@@ -11,32 +12,9 @@ class SchemaTest extends FeatureTestCase
1112{
1213 public function testSchema ()
1314 {
14- $ user = (object )[
15- 'type ' => 'user ' ,
16- 'fields ' => ['name ' , 'email ' ],
17- 'relationships ' => [
18- 'posts ' => null ,
19- 'comments ' => null ,
20- ]
21- ];
22-
23- $ post = (object )[
24- 'type ' => 'post ' ,
25- 'fields ' => ['title ' , 'content ' ],
26- 'relationships ' => [
27- 'user ' => null ,
28- 'comments ' => null ,
29- ]
30- ];
31-
32- $ comment = (object )[
33- 'type ' => 'comment ' ,
34- 'fields ' => ['content ' ],
35- 'relationships ' => [
36- 'user ' => null ,
37- 'post ' => null ,
38- ]
39- ];
15+ $ user = new Skeleton (UserResource::class, 'user ' , ['name ' , 'email ' ]);
16+ $ post = new Skeleton (PostResource::class, 'post ' , ['title ' , 'content ' ]);
17+ $ comment = new Skeleton (CommentResource::class, 'comment ' , ['content ' ]);
4018
4119 $ user ->relationships ['posts ' ] = $ post ;
4220 $ user ->relationships ['comments ' ] = $ comment ;
You can’t perform that action at this time.
0 commit comments