Skip to content

Commit a46e6d1

Browse files
committed
test(LaravelDataTest): Remove version checks for pagination tests
- Remove the conditional skips for versions 10.0.0 and 9.0.0 in pagination tests - Update the snapshot tests to include new cursor metadata - Ensure consistent behavior across different Laravel versions
1 parent 064f76d commit a46e6d1

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

src/Facades/ApiResponseFacade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* @method static \Illuminate\Http\JsonResponse tooManyRequests(string $message = '')
5050
* @method static \Guanguans\LaravelApiResponse\ApiResponse|mixed when(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
5151
* @method static \Guanguans\LaravelApiResponse\ApiResponse|mixed unless(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
52-
* @method static never dd(mixed ...$args)
52+
* @method static void dd(mixed ...$args)
5353
* @method static \Guanguans\LaravelApiResponse\ApiResponse dump(mixed ...$args)
5454
* @method static \Guanguans\LaravelApiResponse\ApiResponse unshiftExceptionPipes(mixed ...$exceptionPipes)
5555
* @method static \Guanguans\LaravelApiResponse\ApiResponse pushExceptionPipes(mixed ...$exceptionPipes)

src/Support/Traits/Dumpable.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ trait Dumpable
2525
{
2626
/**
2727
* Dump the given arguments and terminate execution.
28-
*
29-
* @return never-return
3028
*/
3129
public function dd(mixed ...$args): void
3230
{

tests/Feature/LaravelDataTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@
5858
->success($paginate)
5959
->content()
6060
);
61-
})->group(__DIR__, __FILE__)->with('wraps')->skip(Comparator::greaterThanOrEqualTo(Application::VERSION, '10.0.0'));
61+
})
62+
->group(__DIR__, __FILE__)
63+
// ->skip(Comparator::greaterThanOrEqualTo(Application::VERSION, '10.0.0'))
64+
->with('wraps');
6265

6366
it('is simple paginate', function (?string $wrap): void {
6467
$simplePaginate = User::query()->with(['country', 'posts'])->simplePaginate(3);
@@ -94,7 +97,10 @@
9497
->success($cursorPaginate)
9598
->content()
9699
);
97-
})->group(__DIR__, __FILE__)->with('wraps')->skip(Comparator::greaterThanOrEqualTo(Application::VERSION, '9.0.0'));
100+
})
101+
->group(__DIR__, __FILE__)
102+
// ->skip(Comparator::greaterThanOrEqualTo(Application::VERSION, '9.0.0'))
103+
->with('wraps');
98104

99105
it('is resource', function (): void {
100106
$userResource = UserResource::make(User::query()->with(['country', 'posts'])->first());

tests/__snapshots__/LaravelDataTest__it_is_cursor_paginate_with_(list)__1.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@
107107
},
108108
"meta": {
109109
"path": "http:\/\/localhost",
110-
"per_page": 3
110+
"per_page": 3,
111+
"next_cursor": "eyJ1c2Vycy5pZCI6MywiX3BvaW50c1RvTmV4dEl0ZW1zIjp0cnVlfQ",
112+
"prev_cursor": null
111113
}
112114
},
113115
"error": {}

tests/__snapshots__/LaravelDataTest__it_is_cursor_paginate_with_(null)__1.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@
107107
},
108108
"meta": {
109109
"path": "http:\/\/localhost",
110-
"per_page": 3
110+
"per_page": 3,
111+
"next_cursor": "eyJ1c2Vycy5pZCI6MywiX3BvaW50c1RvTmV4dEl0ZW1zIjp0cnVlfQ",
112+
"prev_cursor": null
111113
}
112114
},
113115
"error": {}

0 commit comments

Comments
 (0)