|
18 | 18 |
|
19 | 19 | // Assert |
20 | 20 | expect($result)->toBeArray(); |
21 | | - expect(array_keys($result))->toEqual(['test', 'type', 'cursor', 'hasMore', 'perPage']); |
| 21 | + expect(array_keys($result))->toEqual(['test', 'type', 'cursor', 'has_more', 'per_page']); |
22 | 22 | expect($result['test'])->toBeInstanceOf(DeferProp::class); |
23 | 23 | expect($result['type']())->toBeInstanceOf(PaginationType::class); |
24 | 24 | expect($result['cursor']())->toBeString(); |
25 | | - expect($result['hasMore']())->toBeTrue(); |
26 | | - expect($result['perPage']())->toBeInt(); |
| 25 | + expect($result['has_more']())->toBeTrue(); |
| 26 | + expect($result['per_page']())->toBeInt(); |
27 | 27 | }); |
28 | 28 |
|
29 | 29 | test('returns cursor pagination data given cursor object', function (): void { |
|
32 | 32 |
|
33 | 33 | // Assert |
34 | 34 | expect($result)->toBeArray(); |
35 | | - expect(array_keys($result))->toEqual(['test', 'type', 'cursor', 'hasMore', 'perPage']); |
| 35 | + expect(array_keys($result))->toEqual(['test', 'type', 'cursor', 'has_more', 'per_page']); |
36 | 36 | expect($result['test'])->toBeInstanceOf(DeferProp::class); |
37 | 37 | expect($result['type']())->toBeInstanceOf(PaginationType::class); |
38 | 38 | expect($result['cursor']())->toBeString(); |
39 | | - expect($result['hasMore']())->toBeTrue(); |
40 | | - expect($result['perPage']())->toBeInt(); |
| 39 | + expect($result['has_more']())->toBeTrue(); |
| 40 | + expect($result['per_page']())->toBeInt(); |
41 | 41 | }); |
42 | 42 |
|
43 | 43 | test('determines if cursor pagination has more pages', function (): void { |
44 | 44 | // Act |
45 | 45 | $result = InfiniteScroll::make('test', TestModel::query(), 20); |
46 | 46 |
|
47 | 47 | // Assert |
48 | | - expect($result['hasMore']())->toBeFalse(); |
| 48 | + expect($result['has_more']())->toBeFalse(); |
49 | 49 | }); |
50 | 50 |
|
51 | 51 | test('returns pagination data given a pagination object', function (): void { |
|
54 | 54 |
|
55 | 55 | // Assert |
56 | 56 | expect($result)->toBeArray(); |
57 | | - expect(array_keys($result))->toEqual(['test', 'type', 'page', 'hasMore', 'perPage']); |
| 57 | + expect(array_keys($result))->toEqual(['test', 'type', 'page', 'has_more', 'per_page']); |
58 | 58 | expect($result['test'])->toBeInstanceOf(DeferProp::class); |
59 | 59 | expect($result['type']())->toBeInstanceOf(PaginationType::class); |
60 | 60 | expect($result['page']())->toBeInt(); |
61 | | - expect($result['hasMore']())->toBeTrue(); |
62 | | - expect($result['perPage']())->toBeInt(); |
| 61 | + expect($result['has_more']())->toBeTrue(); |
| 62 | + expect($result['per_page']())->toBeInt(); |
63 | 63 | }); |
64 | 64 |
|
65 | 65 | test('returns pagination data given a simple pagination object', function (): void { |
|
68 | 68 |
|
69 | 69 | // Assert |
70 | 70 | expect($result)->toBeArray(); |
71 | | - expect(array_keys($result))->toEqual(['test', 'type', 'page', 'hasMore', 'perPage']); |
| 71 | + expect(array_keys($result))->toEqual(['test', 'type', 'page', 'has_more', 'per_page']); |
72 | 72 | expect($result['test'])->toBeInstanceOf(DeferProp::class); |
73 | 73 | expect($result['type']())->toBeInstanceOf(PaginationType::class); |
74 | 74 | expect($result['page']())->toBeInt(); |
75 | | - expect($result['hasMore']())->toBeTrue(); |
76 | | - expect($result['perPage']())->toBeInt(); |
| 75 | + expect($result['has_more']())->toBeTrue(); |
| 76 | + expect($result['per_page']())->toBeInt(); |
77 | 77 | }); |
78 | 78 |
|
79 | 79 | test('determines if pagination has more pages', function (): void { |
80 | 80 | // Act |
81 | 81 | $result = InfiniteScroll::make('test', TestModel::query()->paginate(perPage: 20)); |
82 | 82 |
|
83 | 83 | // Assert |
84 | | - expect($result['hasMore']())->toBeFalse(); |
| 84 | + expect($result['has_more']())->toBeFalse(); |
85 | 85 | }); |
0 commit comments