File tree 3 files changed +34
-31
lines changed
3 files changed +34
-31
lines changed Original file line number Diff line number Diff line change 10
10
use Illuminate \Http \JsonResponse ;
11
11
use Illuminate \Http \Response ;
12
12
use League \Fractal \Pagination \IlluminatePaginatorAdapter ;
13
+
13
14
use function fractal ;
14
15
15
16
final readonly class ContextController
Original file line number Diff line number Diff line change 10
10
use Illuminate \Contracts \Auth \Access \Gate ;
11
11
use Illuminate \Foundation \Http \FormRequest ;
12
12
use Illuminate \Validation \Rule ;
13
+
13
14
use function array_map ;
14
15
15
16
final class ContentRequest extends FormRequest
Original file line number Diff line number Diff line change @@ -25,40 +25,41 @@ public function testListsContexts(): void
25
25
->withBasicAuth ($ user ->getApiKey (), $ user ->getApiSecret ())
26
26
->getJson ('https://hub-test.edlib.test/api/contexts ' )
27
27
->assertOk ()
28
- ->assertJson (fn (AssertableJson $ json ) => $ json
29
- ->where ('data ' , [
30
- [
31
- 'id ' => $ id1 ,
32
- 'name ' => 'context_1 ' ,
33
- 'links ' => [
34
- 'self ' => 'https://hub-test.edlib.test/api/contexts/context_1 ' ,
28
+ ->assertJson (
29
+ fn (AssertableJson $ json ) => $ json
30
+ ->where ('data ' , [
31
+ [
32
+ 'id ' => $ id1 ,
33
+ 'name ' => 'context_1 ' ,
34
+ 'links ' => [
35
+ 'self ' => 'https://hub-test.edlib.test/api/contexts/context_1 ' ,
36
+ ],
35
37
],
36
- ],
37
- [
38
- ' id ' => $ id2 ,
39
- ' name ' => ' context_2 ' ,
40
- ' links ' => [
41
- ' self ' => ' https://hub-test.edlib.test/api/contexts/context_2 ' ,
38
+ [
39
+ ' id ' => $ id2 ,
40
+ ' name ' => ' context_2 ' ,
41
+ ' links ' => [
42
+ ' self ' => ' https://hub-test.edlib.test/api/contexts/context_2 ' ,
43
+ ] ,
42
44
],
43
- ],
44
- [
45
- ' id ' => $ id3 ,
46
- ' name ' => ' context_3 ' ,
47
- ' links ' => [
48
- ' self ' => ' https://hub-test.edlib.test/api/contexts/context_3 ' ,
45
+ [
46
+ ' id ' => $ id3 ,
47
+ ' name ' => ' context_3 ' ,
48
+ ' links ' => [
49
+ ' self ' => ' https://hub-test.edlib.test/api/contexts/context_3 ' ,
50
+ ] ,
49
51
],
50
- ],
51
- ])
52
- ->where ('meta ' , [
53
- 'pagination ' => [
54
- 'count ' => 3 ,
55
- 'current_page ' => 1 ,
56
- 'links ' => [],
57
- 'per_page ' => 100 ,
58
- 'total ' => 3 ,
59
- 'total_pages ' => 1 ,
60
- ],
61
- ])
52
+ ])
53
+ ->where ('meta ' , [
54
+ 'pagination ' => [
55
+ 'count ' => 3 ,
56
+ 'current_page ' => 1 ,
57
+ 'links ' => [],
58
+ 'per_page ' => 100 ,
59
+ 'total ' => 3 ,
60
+ 'total_pages ' => 1 ,
61
+ ],
62
+ ]),
62
63
);
63
64
}
64
65
}
You can’t perform that action at this time.
0 commit comments